set default advanced deployment strategy (#176)

Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
Co-authored-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
This commit is contained in:
Wei-Xiang Sun 2023-12-19 13:23:00 +08:00 committed by GitHub
parent e19a89c16e
commit 862040870d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -95,6 +95,7 @@ func (rc *realController) Initialize(release *v1beta1.BatchRelease) error {
RollingStyle: v1alpha1.PartitionRollingStyle,
RollingUpdate: rollingUpdate,
}
v1alpha1.SetDefaultDeploymentStrategy(&strategy)
d := rc.object.DeepCopy()
patchData := patch.NewDeploymentPatch()

View File

@ -285,6 +285,7 @@ func (h *WorkloadHandler) handleDeployment(newObj, oldObj *apps.Deployment) (boo
modified = true
strategy.Paused = true
}
appsv1alpha1.SetDefaultDeploymentStrategy(&strategy)
setDeploymentStrategyAnnotation(strategy, newObj)
default:
// Do not allow to modify strategy as Recreate during rolling