Add DependentOverriders field to PropagationPolicy

Signed-off-by: RainbowMango <renhongcai@huawei.com>
Co-authored-by: Kevin Wang <kevinwzf0126@gmail.com>
This commit is contained in:
RainbowMango 2021-02-02 11:20:29 +08:00 committed by Kevin Wang
parent 9624634662
commit 77830aada3
3 changed files with 29 additions and 0 deletions

View File

@ -42,6 +42,18 @@ spec:
automatically. e.g. a ConfigMap referred by a Deployment. default
false.
type: boolean
dependentOverrides:
description: "DependentOverrides represents the list of overrides(OverridePolicy)
which must present before the current PropagationPolicy takes effect.
\n It used to explicitly specify overrides which current PropagationPolicy
rely on. A typical scenario is the users create OverridePolicy(ies)
and resources at the same time, they want to ensure the new-created
policies would be adopted. \n Note: For the overrides, OverridePolicy(ies)
in current namespace and ClusterOverridePolicy(ies), which not present
in this list will still be applied if they matches the resources."
items:
type: string
type: array
placement:
description: Placement represents the rule for select clusters to
propagate resources.

View File

@ -33,6 +33,18 @@ type PropagationSpec struct {
// Placement represents the rule for select clusters to propagate resources.
Placement Placement `json:"placement,omitempty"`
// DependentOverrides represents the list of overrides(OverridePolicy)
// which must present before the current PropagationPolicy takes effect.
//
// It used to explicitly specify overrides which current PropagationPolicy rely on.
// A typical scenario is the users create OverridePolicy(ies) and resources at the same time,
// they want to ensure the new-created policies would be adopted.
//
// Note: For the overrides, OverridePolicy(ies) in current namespace and ClusterOverridePolicy(ies),
// which not present in this list will still be applied if they matches the resources.
// +optional
DependentOverrides []string `json:"dependentOverrides,omitempty"`
// SchedulerName represents which scheduler to proceed the scheduling.
// If specified, the policy will be dispatched by specified scheduler.
// If not specified, the policy will be dispatched by default scheduler.

View File

@ -495,6 +495,11 @@ func (in *PropagationSpec) DeepCopyInto(out *PropagationSpec) {
}
}
in.Placement.DeepCopyInto(&out.Placement)
if in.DependentOverrides != nil {
in, out := &in.DependentOverrides, &out.DependentOverrides
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}