controller: Check errors if the IM pod creation fails
Otherwise, createInstanceManagerPod() may keep printing out the
error logs and the IM object cannot be updated successfully.
@@ -407,8 +407,12 @@ func (imc *InstanceManagerController) syncInstanceManager(key string) (err error
return err
}
if err := imc.createInstanceManagerPod(im); err != nil {
+ if !types.ErrorAlreadyExists(errors.Cause(err)) {
return err
}
+ return nil
+ }
+
im.Status.CurrentState = types.InstanceManagerStateStarting
return nil
}
