Have managed resource DeletionPolicy default to 'Delete'

Signed-off-by: Nic Cope <negz@rk0n.org>
This commit is contained in:
Nic Cope 2021-03-15 22:03:42 +00:00
parent c0539b3cb4
commit 50745b7338
2 changed files with 3 additions and 4 deletions

View File

@ -18,6 +18,7 @@ package v1
// A DeletionPolicy determines what should happen to the underlying external // A DeletionPolicy determines what should happen to the underlying external
// resource when a managed resource is deleted. // resource when a managed resource is deleted.
// +kubebuilder:validation:Enum=Orphan;Delete
type DeletionPolicy string type DeletionPolicy string
const ( const (

View File

@ -149,11 +149,9 @@ type ResourceSpec struct {
// DeletionPolicy specifies what will happen to the underlying external // DeletionPolicy specifies what will happen to the underlying external
// when this managed resource is deleted - either "Delete" or "Orphan" the // when this managed resource is deleted - either "Delete" or "Orphan" the
// external resource. The "Delete" policy is the default when no policy is // external resource.
// specified.
//
// +optional // +optional
// +kubebuilder:validation:Enum=Orphan;Delete // +kubebuilder:default=Delete
DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"` DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"`
} }