Skip to content

Commit

Permalink
Add deletionPolicy to the InControlPlaneOverride API
Browse files Browse the repository at this point in the history
Signed-off-by: Alper Rifat Ulucinar <[email protected]>
  • Loading branch information
ulucinar committed Jul 22, 2024
1 parent 347c5ce commit 56a0a1d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion apis/spaces/v1alpha1/incontrolplaneoverride_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ const (
PropagateNone PropagationMode = "None"
)

// DeletionPolicy controls what happens when an InControlPlaneOverride
// object is deleted. We either attempt to roll back the changes on the
// target object hierarchy, or we keep them.
type DeletionPolicy string

const (
// DeletionRollBack attempts to roll back the changes on the target object
// hierarchy when the InControlPlaneOverride object is being deleted.
DeletionRollBack DeletionPolicy = "RollBack"
// DeletionKeep keeps the changes on the target object
// hierarchy when the InControlPlaneOverride object is being deleted.
DeletionKeep DeletionPolicy = "Keep"
)

// Metadata represents the Kube object metadata.
type Metadata struct {
// Annotations represents the Kube object annotations.
Expand Down Expand Up @@ -117,7 +131,12 @@ type InControlPlaneOverrideSpec struct {
// +kubebuilder:validation:Enum=None;Ascending;Descending
// +kubebuilder:default=None
PropagationMode PropagationMode `json:"propagationMode"`
Patch Patch `json:"patch"`

// +kubebuilder:validation:Enum=RollBack;Keep
// +kubebuilder:default=RollBack
DeletionPolicy DeletionPolicy `json:"deletionPolicy"`

Patch Patch `json:"patch"`
}

// PatchState denotes the result of the patch operation on the associated
Expand Down

0 comments on commit 56a0a1d

Please sign in to comment.