Skip to content

Commit

Permalink
fix: change the default value of DeletionPolicy to NoDelete (#162)
Browse files Browse the repository at this point in the history
* fix: change the default value of DeletionPolicy to NoDelete

* update manifests
  • Loading branch information
sanposhiho authored Oct 10, 2023
1 parent 9ab5b47 commit 03b5e44
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/v1beta1/testdata/mutating/after.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: default
spec:
updateMode: "Off"
deletionPolicy: "DeleteAll"
deletionPolicy: "NoDelete"
targetRefs:
scaleTargetRef:
kind: Deployment
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/tortoise_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/tortoise_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/autoscaling.mercari.com_tortoises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03b5e44

Please sign in to comment.