returntargetRelease,errors.Wrapf(fmt.Errorf("unable to cleanup resources: %s",strings.Join(errorList,", ")),"an error occurred while cleaning up resources. original rollback error: %s",err)
u.cfg.Log.Debug("cleanup on fail set","cleaning_resources",len(created))
slog.Debug("cleanup on fail set","cleaning_resources",len(created))
_,errs:=u.cfg.KubeClient.Delete(created)
iferrs!=nil{
varerrorList[]string
@ -502,10 +502,10 @@ func (u *Upgrade) failRelease(rel *release.Release, created kube.ResourceList, e
}
returnrel,errors.Wrapf(fmt.Errorf("unable to cleanup resources: %s",strings.Join(errorList,", ")),"an error occurred while cleaning up resources. original upgrade error: %s",err)
}
u.cfg.Log.Debug("resource cleanup complete")
slog.Debug("resource cleanup complete")
}
ifu.Atomic{
u.cfg.Log.Debug("upgrade failed and atomic is set, rolling back to last successful release")
slog.Debug("upgrade failed and atomic is set, rolling back to last successful release")
// As a protection, get the last successful release before rollback.
// If there are no successful releases, bail out
@ -557,13 +557,13 @@ func (u *Upgrade) failRelease(rel *release.Release, created kube.ResourceList, e
c.Log.Debug("skipping delete due to annotation","namespace",info.Namespace,"name",info.Name,"kind",info.Mapping.GroupVersionKind.Kind,"annotation",ResourcePolicyAnno,"value",KeepPolicy)
slog.Debug("skipping delete due to annotation","namespace",info.Namespace,"name",info.Name,"kind",info.Mapping.GroupVersionKind.Kind,"annotation",ResourcePolicyAnno,"value",KeepPolicy)
c.log.Debug("Deployment is not ready, observedGeneration does not match spec generation","namespace",dep.GetNamespace(),"name",dep.GetName(),"actualGeneration",dep.Status.ObservedGeneration,"expectedGeneration",dep.ObjectMeta.Generation)
slog.Debug("Deployment is not ready, observedGeneration does not match spec generation","namespace",dep.GetNamespace(),"name",dep.GetName(),"actualGeneration",dep.Status.ObservedGeneration,"expectedGeneration",dep.ObjectMeta.Generation)
c.log.Debug("Deployment does not have enough pods ready","namespace",dep.GetNamespace(),"name",dep.GetName(),"readyPods",rs.Status.ReadyReplicas,"totalPods",expectedReady)
slog.Debug("Deployment does not have enough pods ready","namespace",dep.GetNamespace(),"name",dep.GetName(),"readyPods",rs.Status.ReadyReplicas,"totalPods",expectedReady)
c.log.Debug("DaemonSet is not ready, observedGeneration does not match spec generation","namespace",ds.GetNamespace(),"name",ds.GetName(),"observedGeneration",ds.Status.ObservedGeneration,"expectedGeneration",ds.ObjectMeta.Generation)
slog.Debug("DaemonSet is not ready, observedGeneration does not match spec generation","namespace",ds.GetNamespace(),"name",ds.GetName(),"observedGeneration",ds.Status.ObservedGeneration,"expectedGeneration",ds.ObjectMeta.Generation)
c.log.Debug("DaemonSet does not have enough Pods scheduled","namespace",ds.GetNamespace(),"name",ds.GetName(),"scheduledPods",ds.Status.UpdatedNumberScheduled,"totalPods",ds.Status.DesiredNumberScheduled)
slog.Debug("DaemonSet does not have enough Pods scheduled","namespace",ds.GetNamespace(),"name",ds.GetName(),"scheduledPods",ds.Status.UpdatedNumberScheduled,"totalPods",ds.Status.DesiredNumberScheduled)
c.log.Debug("DaemonSet does not have enough Pods ready","namespace",ds.GetNamespace(),"name",ds.GetName(),"readyPods",ds.Status.NumberReady,"totalPods",expectedReady)
slog.Debug("DaemonSet does not have enough Pods ready","namespace",ds.GetNamespace(),"name",ds.GetName(),"readyPods",ds.Status.NumberReady,"totalPods",expectedReady)
c.log.Debug("StatefulSet is not ready, observedGeneration doest not match spec generation","namespace",sts.GetNamespace(),"name",sts.GetName(),"actualGeneration",sts.Status.ObservedGeneration,"expectedGeneration",sts.ObjectMeta.Generation)
slog.Debug("StatefulSet is not ready, observedGeneration doest not match spec generation","namespace",sts.GetNamespace(),"name",sts.GetName(),"actualGeneration",sts.Status.ObservedGeneration,"expectedGeneration",sts.ObjectMeta.Generation)
returnfalse
}
// If the update strategy is not a rolling update, there will be nothing to wait for
c.log.Debug("StatefulSet does not have enough Pods scheduled","namespace",sts.GetNamespace(),"name",sts.GetName(),"readyPods",sts.Status.UpdatedReplicas,"totalPods",expectedReplicas)
slog.Debug("StatefulSet does not have enough Pods scheduled","namespace",sts.GetNamespace(),"name",sts.GetName(),"readyPods",sts.Status.UpdatedReplicas,"totalPods",expectedReplicas)
returnfalse
}
ifint(sts.Status.ReadyReplicas)!=replicas{
c.log.Debug("StatefulSet does not have enough Pods ready","namespace",sts.GetNamespace(),"name",sts.GetName(),"readyPods",sts.Status.ReadyReplicas,"totalPods",replicas)
slog.Debug("StatefulSet does not have enough Pods ready","namespace",sts.GetNamespace(),"name",sts.GetName(),"readyPods",sts.Status.ReadyReplicas,"totalPods",replicas)
returnfalse
}
// This check only makes sense when all partitions are being upgraded otherwise during a
// partitioned rolling upgrade, this condition will never evaluate to true, leading to
c.log.Debug("StatefulSet is not ready, currentRevision does not match updateRevision","namespace",sts.GetNamespace(),"name",sts.GetName(),"currentRevision",sts.Status.CurrentRevision,"updateRevision",sts.Status.UpdateRevision)
slog.Debug("StatefulSet is not ready, currentRevision does not match updateRevision","namespace",sts.GetNamespace(),"name",sts.GetName(),"currentRevision",sts.Status.CurrentRevision,"updateRevision",sts.Status.UpdateRevision)
returnfalse
}
c.log.Debug("StatefulSet is ready","namespace",sts.GetNamespace(),"name",sts.GetName(),"readyPods",sts.Status.ReadyReplicas,"totalPods",replicas)
slog.Debug("StatefulSet is ready","namespace",sts.GetNamespace(),"name",sts.GetName(),"readyPods",sts.Status.ReadyReplicas,"totalPods",replicas)
c.log.Debug("ReplicationController is not ready, observedGeneration doest not match spec generation","namespace",rc.GetNamespace(),"name",rc.GetName(),"actualGeneration",rc.Status.ObservedGeneration,"expectedGeneration",rc.ObjectMeta.Generation)
slog.Debug("ReplicationController is not ready, observedGeneration doest not match spec generation","namespace",rc.GetNamespace(),"name",rc.GetName(),"actualGeneration",rc.Status.ObservedGeneration,"expectedGeneration",rc.ObjectMeta.Generation)
c.log.Debug("ReplicaSet is not ready, observedGeneration doest not match spec generation","namespace",rs.GetNamespace(),"name",rs.GetName(),"actualGeneration",rs.Status.ObservedGeneration,"expectedGeneration",rs.ObjectMeta.Generation)
slog.Debug("ReplicaSet is not ready, observedGeneration doest not match spec generation","namespace",rs.GetNamespace(),"name",rs.GetName(),"actualGeneration",rs.Status.ObservedGeneration,"expectedGeneration",rs.ObjectMeta.Generation)
logger.Debug("waiting for resource","name",first.Identifier.Name,"kind",first.Identifier.GroupKind.Kind,"expectedStatus",desired,"actualStatus",first.Status)
slog.Debug("waiting for resource","name",first.Identifier.Name,"kind",first.Identifier.GroupKind.Kind,"expectedStatus",desired,"actualStatus",first.Status)