Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppliedOverrides ¶
type AppliedOverrides struct { // AppliedItems is the list of applied overriders. AppliedItems []OverridePolicyShadow `json:"appliedItems,omitempty"` }
AppliedOverrides is the list of applied overriders.
func (*AppliedOverrides) Add ¶
func (ao *AppliedOverrides) Add(policyName string, overriders policyv1alpha1.Overriders)
Add appends an item to AppliedItems.
func (*AppliedOverrides) AscendOrder ¶
func (ao *AppliedOverrides) AscendOrder()
AscendOrder sort the applied items in ascending order.
func (*AppliedOverrides) MarshalJSON ¶
func (ao *AppliedOverrides) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON encoding of applied overrides.
type GeneralOverridePolicy ¶
type GeneralOverridePolicy interface { // GetName returns the name of OverridePolicy GetName() string // GetNamespace returns the namespace of OverridePolicy GetNamespace() string // GetOverridePolicySpec returns the OverridePolicySpec of OverridePolicy GetOverridePolicySpec() policyv1alpha1.OverridePolicySpec }
GeneralOverridePolicy is an abstract object of ClusterOverridePolicy and OverridePolicy
type OverrideManager ¶
type OverrideManager interface { // ApplyOverridePolicies overrides the object if one or more matched override policies exist. // For cluster scoped resource: // - Apply ClusterOverridePolicy by policies name in ascending // For namespaced scoped resource, apply order is: // - First apply ClusterOverridePolicy; // - Then apply OverridePolicy; ApplyOverridePolicies(ctx context.Context, rawObj, oldObj *unstructured.Unstructured, operation admissionv1.Operation) (appliedCOPs *AppliedOverrides, appliedOPs *AppliedOverrides, err error) }
OverrideManager managers override policies for operation
func NewOverrideManager ¶
func NewOverrideManager(dynamicClient dynamiclister.DynamicResourceLister, copLister v1alpha1.ClusterOverridePolicyLister, opLister v1alpha1.OverridePolicyLister) OverrideManager
type OverridePolicyShadow ¶
type OverridePolicyShadow struct { // PolicyName is the name of the referencing policy. PolicyName string `json:"policyName"` // Overriders is the overrider list of the referencing policy. Overriders policyv1alpha1.Overriders `json:"overriders"` }
OverridePolicyShadow is the condensed version of a OverridePolicy.
Click to show internal directories.
Click to hide internal directories.