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:
stefanprodan
2019-06-19 09:49:25 +03:00
parent f25023ed1b
commit 9a87d47f45
+5
View File
@@ -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