overridemanager

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 17 Imported by: 3

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL