diff --git a/api/v1beta1/testdata/mutating/after.yaml b/api/v1beta1/testdata/mutating/after.yaml index 599da814..91ab691c 100644 --- a/api/v1beta1/testdata/mutating/after.yaml +++ b/api/v1beta1/testdata/mutating/after.yaml @@ -5,7 +5,7 @@ metadata: namespace: default spec: updateMode: "Off" - deletionPolicy: "DeleteAll" + deletionPolicy: "NoDelete" targetRefs: scaleTargetRef: kind: Deployment diff --git a/api/v1beta1/tortoise_types.go b/api/v1beta1/tortoise_types.go index 9855600c..9d632486 100644 --- a/api/v1beta1/tortoise_types.go +++ b/api/v1beta1/tortoise_types.go @@ -59,7 +59,7 @@ type TortoiseSpec struct { // which is associated by spec.targetRefs.horizontalPodAutoscalerName, tortoise never delete the HPA. // If "NoDelete", tortoise doesn't delete any associated HPA and VPAs. // - // "DeleteAll" is the default value. + // "NoDelete" is the default value. // +optional DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty" protobuf:"bytes,4,opt,name=deletionPolicy"` } diff --git a/api/v1beta1/tortoise_webhook.go b/api/v1beta1/tortoise_webhook.go index 3938a63f..ba0e6f77 100644 --- a/api/v1beta1/tortoise_webhook.go +++ b/api/v1beta1/tortoise_webhook.go @@ -73,7 +73,7 @@ func (r *Tortoise) Default() { r.Spec.UpdateMode = UpdateModeOff } if r.Spec.DeletionPolicy == "" { - r.Spec.DeletionPolicy = DeletionPolicyDeleteAll + r.Spec.DeletionPolicy = DeletionPolicyNoDelete } if r.Spec.TargetRefs.ScaleTargetRef.Kind == "Deployment" { diff --git a/config/crd/bases/autoscaling.mercari.com_tortoises.yaml b/config/crd/bases/autoscaling.mercari.com_tortoises.yaml index da82a056..95d4d6f3 100644 --- a/config/crd/bases/autoscaling.mercari.com_tortoises.yaml +++ b/config/crd/bases/autoscaling.mercari.com_tortoises.yaml @@ -391,7 +391,7 @@ spec: If the associated HPA is not created by tortoise, which is associated by spec.targetRefs.horizontalPodAutoscalerName, tortoise never delete the HPA. If \"NoDelete\", tortoise doesn't delete any associated - HPA and VPAs. \n \"DeleteAll\" is the default value." + HPA and VPAs. \n \"NoDelete\" is the default value." enum: - DeleteAll - NoDelete diff --git a/manifests/crd/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml b/manifests/crd/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml index 8454814d..73c574be 100644 --- a/manifests/crd/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml +++ b/manifests/crd/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml @@ -325,7 +325,7 @@ spec: description: TortoiseSpec defines the desired state of Tortoise properties: deletionPolicy: - description: "DeletionPolicy is the policy how the controller deletes associated HPA and VPAs when tortoise is removed. If \"DeleteAll\", tortoise deletes all associated HPA and VPAs, created by tortoise. If the associated HPA is not created by tortoise, which is associated by spec.targetRefs.horizontalPodAutoscalerName, tortoise never delete the HPA. If \"NoDelete\", tortoise doesn't delete any associated HPA and VPAs. \n \"DeleteAll\" is the default value." + description: "DeletionPolicy is the policy how the controller deletes associated HPA and VPAs when tortoise is removed. If \"DeleteAll\", tortoise deletes all associated HPA and VPAs, created by tortoise. If the associated HPA is not created by tortoise, which is associated by spec.targetRefs.horizontalPodAutoscalerName, tortoise never delete the HPA. If \"NoDelete\", tortoise doesn't delete any associated HPA and VPAs. \n \"NoDelete\" is the default value." enum: - DeleteAll - NoDelete diff --git a/manifests/default/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml b/manifests/default/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml index 73cd3fb1..06dbcfa4 100644 --- a/manifests/default/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml +++ b/manifests/default/apiextensions.k8s.io_v1_customresourcedefinition_tortoises.autoscaling.mercari.com.yaml @@ -325,7 +325,7 @@ spec: description: TortoiseSpec defines the desired state of Tortoise properties: deletionPolicy: - description: "DeletionPolicy is the policy how the controller deletes associated HPA and VPAs when tortoise is removed. If \"DeleteAll\", tortoise deletes all associated HPA and VPAs, created by tortoise. If the associated HPA is not created by tortoise, which is associated by spec.targetRefs.horizontalPodAutoscalerName, tortoise never delete the HPA. If \"NoDelete\", tortoise doesn't delete any associated HPA and VPAs. \n \"DeleteAll\" is the default value." + description: "DeletionPolicy is the policy how the controller deletes associated HPA and VPAs when tortoise is removed. If \"DeleteAll\", tortoise deletes all associated HPA and VPAs, created by tortoise. If the associated HPA is not created by tortoise, which is associated by spec.targetRefs.horizontalPodAutoscalerName, tortoise never delete the HPA. If \"NoDelete\", tortoise doesn't delete any associated HPA and VPAs. \n \"NoDelete\" is the default value." enum: - DeleteAll - NoDelete