Documentation ¶
Index ¶
Constants ¶
View Source
const ( PolicyKind = "Policy" ClusterPolicyKind = "ClusterPolicy" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventPublisher ¶ added in v1.0.0
type EventPublisher struct {
// contains filtered or unexported fields
}
func NewEventPublisher ¶ added in v1.0.0
func NewEventPublisher() *EventPublisher
NewEventPublisher constructure for EventPublisher
func (*EventPublisher) GetListener ¶ added in v1.0.0
func (p *EventPublisher) GetListener() []PolicyListener
GetListener returns a list of all registered Listeners
func (*EventPublisher) Publish ¶ added in v1.0.0
func (p *EventPublisher) Publish(event LifecycleEvent)
Publish events to the registered listeners
func (*EventPublisher) RegisterListener ¶ added in v1.0.0
func (p *EventPublisher) RegisterListener(listener PolicyListener)
RegisterListener register Handlers called on each PolicyReport watch.Event
type LifecycleEvent ¶ added in v1.0.0
LifecycleEvent of Policys
type Policy ¶
type Policy struct { Kind string `json:"kind"` Name string `json:"name"` Namespace string `json:"namespace,omitempty"` AutogenControllers []string `json:"autogenControllers,omitempty"` ValidationFailureAction string `json:"validationFailureAction,omitempty"` Background bool `json:"background"` Rules []*Rule `json:"rules"` Category string `json:"category,omitempty"` Description string `json:"description,omitempty"` Severity string `json:"severity,omitempty"` CreationTimestamp time.Time `json:"creationTimestamp,omitempty"` UID string `json:"uid,omitempty"` Content string `json:"content"` }
Policy spec clusterpolicies.kyverno.io/v1.Policy
type PolicyClient ¶
type PolicyClient interface { // Run watches for Policy Events Run(chan struct{}) error // HasSynced all CRDs HasSynced() bool }
PolicyClient to watch for LifecycleEvents in the cluster
type PolicyListener ¶ added in v1.0.0
type PolicyListener = func(LifecycleEvent)
PolicyListener is called whenver a new Policy comes in
type PolicyStore ¶
type PolicyStore struct {
// contains filtered or unexported fields
}
PolicyStore persists the last state of a Policy in memory
func NewPolicyStore ¶
func NewPolicyStore() *PolicyStore
NewPolicyStore returns a pointer to a new in memory store
Click to show internal directories.
Click to hide internal directories.