Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RBCacheRefresher ¶
type RBCacheRefresher interface {
RefreshRules()
}
RBCacheRefresher triggers a cache refresh after rules are synced.
type RuleSyncer ¶
type RuleSyncer interface {
SyncRules(rules []armotypes.RuntimeRule)
}
RuleSyncer receives a filtered set of k8s-admission rules and applies them.
type RulesWatcher ¶
type RulesWatcher struct {
// contains filtered or unexported fields
}
RulesWatcher implements watcher.Adaptor, watching the Rules CRD and syncing any k8s-admission rules to the provided RuleSyncer.
func NewRulesWatcher ¶
func NewRulesWatcher(k8sClient k8sclient.K8sClientInterface, ruleSyncer RuleSyncer, cacheRefresher RBCacheRefresher) *RulesWatcher
NewRulesWatcher creates a RulesWatcher that watches the Rules CRD and delegates matching rules to ruleSyncer. If cacheRefresher is non-nil it is called after every sync.
func (*RulesWatcher) AddHandler ¶
func (w *RulesWatcher) AddHandler(ctx context.Context, _ runtime.Object)
AddHandler implements watcher.Adaptor. Any add event triggers a full sync.
func (*RulesWatcher) DeleteHandler ¶
func (w *RulesWatcher) DeleteHandler(ctx context.Context, _ runtime.Object)
DeleteHandler implements watcher.Adaptor. Any delete event triggers a full sync.
func (*RulesWatcher) ModifyHandler ¶
func (w *RulesWatcher) ModifyHandler(ctx context.Context, _ runtime.Object)
ModifyHandler implements watcher.Adaptor. Any modify event triggers a full sync.
func (*RulesWatcher) WatchResources ¶
func (w *RulesWatcher) WatchResources() []watcher.WatchResource
WatchResources implements watcher.Adaptor.