Documentation ¶
Index ¶
- Constants
- Variables
- func CanAutoGen(spec *kyvernov1.Spec) (applyAutoGen bool, controllers sets.Set[string])
- func ComputeRules(p kyvernov1.PolicyInterface, kind string) []kyvernov1.Rule
- func GetControllers(meta *metav1.ObjectMeta, spec *kyvernov1.Spec) ([]string, []string, []string)
- func GetRequestedControllers(meta *metav1.ObjectMeta) sets.Set[string]
- func GetSupportedControllers(spec *kyvernov1.Spec) sets.Set[string]
Constants ¶
View Source
const (
// PodControllerCronJob represent CronJob string
PodControllerCronJob = "CronJob"
)
Variables ¶
View Source
var (
PodControllers = sets.New("DaemonSet", "Deployment", "Job", "StatefulSet", "ReplicaSet", "ReplicationController", "CronJob")
)
Functions ¶
func CanAutoGen ¶
CanAutoGen checks whether the rule(s) (in policy) can be applied to Pod controllers returns controllers as: - "" if:
- name or selector is defined
- mixed kinds (Pod + pod controller) is defined
- Pod and PodControllers are not defined
- mutate.Patches/mutate.PatchesJSON6902/validate.deny/generate rule is defined
- otherwise it returns all pod controllers
func ComputeRules ¶
func ComputeRules(p kyvernov1.PolicyInterface, kind string) []kyvernov1.Rule
func GetControllers ¶
GetControllers computes the autogen controllers that should be applied to a policy. It returns the requested, supported and effective controllers (intersection of requested and supported ones).
func GetRequestedControllers ¶
func GetRequestedControllers(meta *metav1.ObjectMeta) sets.Set[string]
GetRequestedControllers returns the requested autogen controllers based on object annotations.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.