mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Check primary readiness on initialisation
Wait for the primary to become ready before scaling down the canary in the init phase
This commit is contained in:
@@ -40,6 +40,11 @@ func (c *Deployer) Initialize(cd *flaggerv1.Canary) (label string, ports *map[st
|
||||
}
|
||||
|
||||
if cd.Status.Phase == "" {
|
||||
_, readyErr := c.IsPrimaryReady(cd)
|
||||
if readyErr != nil {
|
||||
return "", ports, readyErr
|
||||
}
|
||||
|
||||
c.Logger.With("canary", fmt.Sprintf("%s.%s", cd.Name, cd.Namespace)).Infof("Scaling down %s.%s", cd.Spec.TargetRef.Name, cd.Namespace)
|
||||
if err := c.Scale(cd, 0); err != nil {
|
||||
return "", ports, err
|
||||
|
||||
Reference in New Issue
Block a user