Merge pull request #5575 from RainbowMango/pr_propose_preserve_api
Proposing API to support migration rollback
This commit is contained in:
commit
a70551ad92
|
@ -19098,6 +19098,10 @@
|
|||
"Never"
|
||||
]
|
||||
},
|
||||
"preserveResourcesOnDeletion": {
|
||||
"description": "PreserveResourcesOnDeletion controls whether resources should be preserved on the member clusters when the resource template is deleted. If set to true, resources will be preserved on the member clusters. Default is false, which means resources will be deleted along with the resource template.\n\nThis setting is particularly useful during workload migration scenarios to ensure that rollback can occur quickly without affecting the workloads running on the member clusters.\n\nAdditionally, this setting applies uniformly across all member clusters and will not selectively control preservation on only some clusters.\n\nNote: This setting does not apply to the deletion of the policy itself. When the policy is deleted, the resource templates and their corresponding propagated resources in member clusters will remain unchanged unless explicitly deleted.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"priority": {
|
||||
"description": "Priority indicates the importance of a policy(PropagationPolicy or ClusterPropagationPolicy). A policy will be applied for the matched resource templates if there is no other policies with higher priority at the point of the resource template be processed. Once a resource template has been claimed by a policy, by default it will not be preempted by following policies even with a higher priority. See Preemption for more details.\n\nIn case of two policies have the same priority, the one with a more precise matching rules in ResourceSelectors wins: - matching by name(resourceSelector.name) has higher priority than\n by selector(resourceSelector.labelSelector)\n- matching by selector(resourceSelector.labelSelector) has higher priority\n than by APIVersion(resourceSelector.apiVersion) and Kind(resourceSelector.kind).\nIf there is still no winner at this point, the one with the lower alphabetic order wins, e.g. policy 'bar' has higher priority than 'foo'.\n\nThe higher the value, the higher the priority. Defaults to zero.",
|
||||
"type": "integer",
|
||||
|
@ -19752,6 +19756,10 @@
|
|||
"description": "WorkSpec defines the desired state of Work.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"preserveResourcesOnDeletion": {
|
||||
"description": "PreserveResourcesOnDeletion controls whether resources should be preserved on the member cluster when the Work object is deleted. If set to true, resources will be preserved on the member cluster. Default is false, which means resources will be deleted along with the Work object.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"suspendDispatching": {
|
||||
"description": "SuspendDispatching controls whether dispatching should be suspended, nil means not suspend. Note: true means stop propagating to all clusters.",
|
||||
"type": "boolean"
|
||||
|
@ -20174,6 +20182,10 @@
|
|||
"description": "Placement represents the rule for select clusters to propagate resources.",
|
||||
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.Placement"
|
||||
},
|
||||
"preserveResourcesOnDeletion": {
|
||||
"description": "PreserveResourcesOnDeletion controls whether resources should be preserved on the member clusters when the binding object is deleted. If set to true, resources will be preserved on the member clusters. Default is false, which means resources will be deleted along with the binding object. This setting applies to all Work objects created under this binding object.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"propagateDeps": {
|
||||
"description": "PropagateDeps tells if relevant resources should be propagated automatically. It is inherited from PropagationPolicy or ClusterPropagationPolicy. default false.",
|
||||
"type": "boolean"
|
||||
|
|
|
@ -687,6 +687,27 @@ spec:
|
|||
- Always
|
||||
- Never
|
||||
type: string
|
||||
preserveResourcesOnDeletion:
|
||||
description: |-
|
||||
PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
member clusters when the resource template is deleted.
|
||||
If set to true, resources will be preserved on the member clusters.
|
||||
Default is false, which means resources will be deleted along with the resource template.
|
||||
|
||||
|
||||
This setting is particularly useful during workload migration scenarios to ensure
|
||||
that rollback can occur quickly without affecting the workloads running on the
|
||||
member clusters.
|
||||
|
||||
|
||||
Additionally, this setting applies uniformly across all member clusters and will not
|
||||
selectively control preservation on only some clusters.
|
||||
|
||||
|
||||
Note: This setting does not apply to the deletion of the policy itself.
|
||||
When the policy is deleted, the resource templates and their corresponding
|
||||
propagated resources in member clusters will remain unchanged unless explicitly deleted.
|
||||
type: boolean
|
||||
priority:
|
||||
default: 0
|
||||
description: |-
|
||||
|
|
|
@ -684,6 +684,27 @@ spec:
|
|||
- Always
|
||||
- Never
|
||||
type: string
|
||||
preserveResourcesOnDeletion:
|
||||
description: |-
|
||||
PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
member clusters when the resource template is deleted.
|
||||
If set to true, resources will be preserved on the member clusters.
|
||||
Default is false, which means resources will be deleted along with the resource template.
|
||||
|
||||
|
||||
This setting is particularly useful during workload migration scenarios to ensure
|
||||
that rollback can occur quickly without affecting the workloads running on the
|
||||
member clusters.
|
||||
|
||||
|
||||
Additionally, this setting applies uniformly across all member clusters and will not
|
||||
selectively control preservation on only some clusters.
|
||||
|
||||
|
||||
Note: This setting does not apply to the deletion of the policy itself.
|
||||
When the policy is deleted, the resource templates and their corresponding
|
||||
propagated resources in member clusters will remain unchanged unless explicitly deleted.
|
||||
type: boolean
|
||||
priority:
|
||||
default: 0
|
||||
description: |-
|
||||
|
|
|
@ -930,6 +930,14 @@ spec:
|
|||
type: object
|
||||
type: array
|
||||
type: object
|
||||
preserveResourcesOnDeletion:
|
||||
description: |-
|
||||
PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
member clusters when the binding object is deleted.
|
||||
If set to true, resources will be preserved on the member clusters.
|
||||
Default is false, which means resources will be deleted along with the binding object.
|
||||
This setting applies to all Work objects created under this binding object.
|
||||
type: boolean
|
||||
propagateDeps:
|
||||
description: |-
|
||||
PropagateDeps tells if relevant resources should be propagated automatically.
|
||||
|
|
|
@ -930,6 +930,14 @@ spec:
|
|||
type: object
|
||||
type: array
|
||||
type: object
|
||||
preserveResourcesOnDeletion:
|
||||
description: |-
|
||||
PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
member clusters when the binding object is deleted.
|
||||
If set to true, resources will be preserved on the member clusters.
|
||||
Default is false, which means resources will be deleted along with the binding object.
|
||||
This setting applies to all Work objects created under this binding object.
|
||||
type: boolean
|
||||
propagateDeps:
|
||||
description: |-
|
||||
PropagateDeps tells if relevant resources should be propagated automatically.
|
||||
|
|
|
@ -54,6 +54,13 @@ spec:
|
|||
spec:
|
||||
description: Spec represents the desired behavior of Work.
|
||||
properties:
|
||||
preserveResourcesOnDeletion:
|
||||
description: |-
|
||||
PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
member cluster when the Work object is deleted.
|
||||
If set to true, resources will be preserved on the member cluster.
|
||||
Default is false, which means resources will be deleted along with the Work object.
|
||||
type: boolean
|
||||
suspendDispatching:
|
||||
description: |-
|
||||
SuspendDispatching controls whether dispatching should
|
||||
|
|
|
@ -181,6 +181,25 @@ type PropagationSpec struct {
|
|||
// nil means no suspension. no default values.
|
||||
// +optional
|
||||
Suspension *Suspension `json:"suspension,omitempty"`
|
||||
|
||||
// PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
// member clusters when the resource template is deleted.
|
||||
// If set to true, resources will be preserved on the member clusters.
|
||||
// Default is false, which means resources will be deleted along with the resource template.
|
||||
//
|
||||
// This setting is particularly useful during workload migration scenarios to ensure
|
||||
// that rollback can occur quickly without affecting the workloads running on the
|
||||
// member clusters.
|
||||
//
|
||||
// Additionally, this setting applies uniformly across all member clusters and will not
|
||||
// selectively control preservation on only some clusters.
|
||||
//
|
||||
// Note: This setting does not apply to the deletion of the policy itself.
|
||||
// When the policy is deleted, the resource templates and their corresponding
|
||||
// propagated resources in member clusters will remain unchanged unless explicitly deleted.
|
||||
//
|
||||
// +optional
|
||||
PreserveResourcesOnDeletion *bool `json:"preserveResourcesOnDeletion,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceSelector the resources will be selected.
|
||||
|
|
|
@ -843,6 +843,11 @@ func (in *PropagationSpec) DeepCopyInto(out *PropagationSpec) {
|
|||
*out = new(Suspension)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PreserveResourcesOnDeletion != nil {
|
||||
in, out := &in.PreserveResourcesOnDeletion, &out.PreserveResourcesOnDeletion
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,13 @@ type WorkSpec struct {
|
|||
// Note: true means stop propagating to all clusters.
|
||||
// +optional
|
||||
SuspendDispatching *bool `json:"suspendDispatching,omitempty"`
|
||||
|
||||
// PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
// member cluster when the Work object is deleted.
|
||||
// If set to true, resources will be preserved on the member cluster.
|
||||
// Default is false, which means resources will be deleted along with the Work object.
|
||||
// +optional
|
||||
PreserveResourcesOnDeletion *bool `json:"preserveResourcesOnDeletion,omitempty"`
|
||||
}
|
||||
|
||||
// WorkloadTemplate represents the manifest workload to be deployed on managed cluster.
|
||||
|
|
|
@ -386,6 +386,11 @@ func (in *WorkSpec) DeepCopyInto(out *WorkSpec) {
|
|||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
if in.PreserveResourcesOnDeletion != nil {
|
||||
in, out := &in.PreserveResourcesOnDeletion, &out.PreserveResourcesOnDeletion
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -151,6 +151,14 @@ type ResourceBindingSpec struct {
|
|||
// nil means no suspension. no default values.
|
||||
// +optional
|
||||
Suspension *policyv1alpha1.Suspension `json:"suspension,omitempty"`
|
||||
|
||||
// PreserveResourcesOnDeletion controls whether resources should be preserved on the
|
||||
// member clusters when the binding object is deleted.
|
||||
// If set to true, resources will be preserved on the member clusters.
|
||||
// Default is false, which means resources will be deleted along with the binding object.
|
||||
// This setting applies to all Work objects created under this binding object.
|
||||
// +optional
|
||||
PreserveResourcesOnDeletion *bool `json:"preserveResourcesOnDeletion,omitempty"`
|
||||
}
|
||||
|
||||
// ObjectReference contains enough information to locate the referenced object inside current cluster.
|
||||
|
|
|
@ -353,6 +353,11 @@ func (in *ResourceBindingSpec) DeepCopyInto(out *ResourceBindingSpec) {
|
|||
*out = new(v1alpha1.Suspension)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.PreserveResourcesOnDeletion != nil {
|
||||
in, out := &in.PreserveResourcesOnDeletion, &out.PreserveResourcesOnDeletion
|
||||
*out = new(bool)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -4878,6 +4878,13 @@ func schema_pkg_apis_policy_v1alpha1_PropagationSpec(ref common.ReferenceCallbac
|
|||
Ref: ref("github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.Suspension"),
|
||||
},
|
||||
},
|
||||
"preserveResourcesOnDeletion": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PreserveResourcesOnDeletion controls whether resources should be preserved on the member clusters when the resource template is deleted. If set to true, resources will be preserved on the member clusters. Default is false, which means resources will be deleted along with the resource template.\n\nThis setting is particularly useful during workload migration scenarios to ensure that rollback can occur quickly without affecting the workloads running on the member clusters.\n\nAdditionally, this setting applies uniformly across all member clusters and will not selectively control preservation on only some clusters.\n\nNote: This setting does not apply to the deletion of the policy itself. When the policy is deleted, the resource templates and their corresponding propagated resources in member clusters will remain unchanged unless explicitly deleted.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"resourceSelectors"},
|
||||
},
|
||||
|
@ -6383,6 +6390,13 @@ func schema_pkg_apis_work_v1alpha1_WorkSpec(ref common.ReferenceCallback) common
|
|||
Format: "",
|
||||
},
|
||||
},
|
||||
"preserveResourcesOnDeletion": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PreserveResourcesOnDeletion controls whether resources should be preserved on the member cluster when the Work object is deleted. If set to true, resources will be preserved on the member cluster. Default is false, which means resources will be deleted along with the Work object.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -7105,6 +7119,13 @@ func schema_pkg_apis_work_v1alpha2_ResourceBindingSpec(ref common.ReferenceCallb
|
|||
Ref: ref("github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.Suspension"),
|
||||
},
|
||||
},
|
||||
"preserveResourcesOnDeletion": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PreserveResourcesOnDeletion controls whether resources should be preserved on the member clusters when the binding object is deleted. If set to true, resources will be preserved on the member clusters. Default is false, which means resources will be deleted along with the binding object. This setting applies to all Work objects created under this binding object.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"resource"},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue