Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CommandString command string CommandString = "command" // ArgsString args string ArgsString = "args" )
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 // GetOverrideSpec returns the OverrideSpec of OverridePolicy GetOverrideSpec() policyv1alpha1.OverrideSpec }
GeneralOverridePolicy is an abstract object of ClusterOverridePolicy and OverridePolicy
type OverrideManager ¶
type OverrideManager interface { // ApplyOverridePolicies overrides the object if one or more override policies exist and matches the target cluster. // 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(rawObj *unstructured.Unstructured, cluster string) (appliedClusterPolicies *AppliedOverrides, appliedNamespacedPolicies *AppliedOverrides, err error) }
OverrideManager managers override policies operation
func New ¶
func New(client karmadaversioned.Interface, cops []policyv1alpha1.ClusterOverridePolicy, ops []policyv1alpha1.OverridePolicy) OverrideManager
New builds an OverrideManager instance.
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 or ClusterOverridePolicy.
Click to show internal directories.
Click to hide internal directories.