Ready check logs are for debug output only

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
pull/30698/head
Benoit Tigeot 6 months ago
parent 496e6702ea
commit ef03e2bd7b
No known key found for this signature in database
GPG Key ID: 8E6D4FC8AEBDA62C

@ -226,18 +226,18 @@ func (c *ReadyChecker) isPodReady(pod *corev1.Pod) bool {
return true return true
} }
} }
slog.Info("Pod is not ready", "namespace", pod.GetNamespace(), "name", pod.GetName()) slog.Debug("Pod is not ready", "namespace", pod.GetNamespace(), "name", pod.GetName())
return false return false
} }
func (c *ReadyChecker) jobReady(job *batchv1.Job) (bool, error) { func (c *ReadyChecker) jobReady(job *batchv1.Job) (bool, error) {
if job.Status.Failed > *job.Spec.BackoffLimit { if job.Status.Failed > *job.Spec.BackoffLimit {
slog.Info("Job failed", "namespace", job.GetNamespace(), "name", job.GetName()) slog.Debug("Job failed", "namespace", job.GetNamespace(), "name", job.GetName())
// If a job is failed, it can't recover, so throw an error // If a job is failed, it can't recover, so throw an error
return false, fmt.Errorf("job is failed: %s/%s", job.GetNamespace(), job.GetName()) return false, fmt.Errorf("job is failed: %s/%s", job.GetNamespace(), job.GetName())
} }
if job.Spec.Completions != nil && job.Status.Succeeded < *job.Spec.Completions { if job.Spec.Completions != nil && job.Status.Succeeded < *job.Spec.Completions {
slog.Info("Job is not completed", "namespace", job.GetNamespace(), "name", job.GetName()) slog.Debug("Job is not completed", "namespace", job.GetNamespace(), "name", job.GetName())
return false, nil return false, nil
} }
return true, nil return true, nil
@ -251,7 +251,7 @@ func (c *ReadyChecker) serviceReady(s *corev1.Service) bool {
// Ensure that the service cluster IP is not empty // Ensure that the service cluster IP is not empty
if s.Spec.ClusterIP == "" { if s.Spec.ClusterIP == "" {
slog.Info("Service does not have cluster IP address", "namespace", s.GetNamespace(), "name", s.GetName()) slog.Debug("Service does not have cluster IP address", "namespace", s.GetNamespace(), "name", s.GetName())
return false return false
} }
@ -259,12 +259,12 @@ func (c *ReadyChecker) serviceReady(s *corev1.Service) bool {
if s.Spec.Type == corev1.ServiceTypeLoadBalancer { if s.Spec.Type == corev1.ServiceTypeLoadBalancer {
// do not wait when at least 1 external IP is set // do not wait when at least 1 external IP is set
if len(s.Spec.ExternalIPs) > 0 { if len(s.Spec.ExternalIPs) > 0 {
slog.Info("Service has external IP addresses, marking as ready", "namespace", s.GetNamespace(), "name", s.GetName(), "externalIPs", s.Spec.ExternalIPs) slog.Debug("Service has external IP addresses, marking as ready", "namespace", s.GetNamespace(), "name", s.GetName(), "externalIPs", s.Spec.ExternalIPs)
return true return true
} }
if s.Status.LoadBalancer.Ingress == nil { if s.Status.LoadBalancer.Ingress == nil {
slog.Info("Service does not have load balancer ingress IP address", "namespace", s.GetNamespace(), "name", s.GetName()) slog.Debug("Service does not have load balancer ingress IP address", "namespace", s.GetNamespace(), "name", s.GetName())
return false return false
} }
} }
@ -274,7 +274,7 @@ func (c *ReadyChecker) serviceReady(s *corev1.Service) bool {
func (c *ReadyChecker) volumeReady(v *corev1.PersistentVolumeClaim) bool { func (c *ReadyChecker) volumeReady(v *corev1.PersistentVolumeClaim) bool {
if v.Status.Phase != corev1.ClaimBound { if v.Status.Phase != corev1.ClaimBound {
slog.Info("PersistentVolumeClaim is not bound", "namespace", v.GetNamespace(), "name", v.GetName()) slog.Debug("PersistentVolumeClaim is not bound", "namespace", v.GetNamespace(), "name", v.GetName())
return false return false
} }
return true return true
@ -287,7 +287,7 @@ func (c *ReadyChecker) deploymentReady(rs *appsv1.ReplicaSet, dep *appsv1.Deploy
} }
// Verify the generation observed by the deployment controller matches the spec generation // Verify the generation observed by the deployment controller matches the spec generation
if dep.Status.ObservedGeneration != dep.ObjectMeta.Generation { if dep.Status.ObservedGeneration != dep.ObjectMeta.Generation {
slog.Info("Deployment is not ready: observedGeneration does not match spec generation", slog.Debug("Deployment is not ready: observedGeneration does not match spec generation",
"namespace", dep.Namespace, "namespace", dep.Namespace,
"name", dep.Name, "name", dep.Name,
"observedGeneration", dep.Status.ObservedGeneration, "observedGeneration", dep.Status.ObservedGeneration,
@ -297,7 +297,7 @@ func (c *ReadyChecker) deploymentReady(rs *appsv1.ReplicaSet, dep *appsv1.Deploy
expectedReady := *dep.Spec.Replicas - deploymentutil.MaxUnavailable(*dep) expectedReady := *dep.Spec.Replicas - deploymentutil.MaxUnavailable(*dep)
if !(rs.Status.ReadyReplicas >= expectedReady) { if !(rs.Status.ReadyReplicas >= expectedReady) {
slog.Info("Deployment is not ready: not enough pods ready", slog.Debug("Deployment is not ready: not enough pods ready",
"namespace", dep.Namespace, "namespace", dep.Namespace,
"name", dep.Name, "name", dep.Name,
"readyReplicas", rs.Status.ReadyReplicas, "readyReplicas", rs.Status.ReadyReplicas,
@ -310,7 +310,7 @@ func (c *ReadyChecker) deploymentReady(rs *appsv1.ReplicaSet, dep *appsv1.Deploy
func (c *ReadyChecker) daemonSetReady(ds *appsv1.DaemonSet) bool { func (c *ReadyChecker) daemonSetReady(ds *appsv1.DaemonSet) bool {
// Verify the generation observed by the daemonSet controller matches the spec generation // Verify the generation observed by the daemonSet controller matches the spec generation
if ds.Status.ObservedGeneration != ds.ObjectMeta.Generation { if ds.Status.ObservedGeneration != ds.ObjectMeta.Generation {
slog.Info("DaemonSet is not ready: observedGeneration does not match spec generation", slog.Debug("DaemonSet is not ready: observedGeneration does not match spec generation",
"namespace", ds.Namespace, "namespace", ds.Namespace,
"name", ds.Name, "name", ds.Name,
"observedGeneration", ds.Status.ObservedGeneration, "observedGeneration", ds.Status.ObservedGeneration,
@ -325,7 +325,7 @@ func (c *ReadyChecker) daemonSetReady(ds *appsv1.DaemonSet) bool {
// Make sure all the updated pods have been scheduled // Make sure all the updated pods have been scheduled
if ds.Status.UpdatedNumberScheduled != ds.Status.DesiredNumberScheduled { if ds.Status.UpdatedNumberScheduled != ds.Status.DesiredNumberScheduled {
slog.Info("DaemonSet is not ready: not enough pods scheduled", slog.Debug("DaemonSet is not ready: not enough pods scheduled",
"namespace", ds.Namespace, "namespace", ds.Namespace,
"name", ds.Name, "name", ds.Name,
"updatedScheduled", ds.Status.UpdatedNumberScheduled, "updatedScheduled", ds.Status.UpdatedNumberScheduled,
@ -342,7 +342,7 @@ func (c *ReadyChecker) daemonSetReady(ds *appsv1.DaemonSet) bool {
expectedReady := int(ds.Status.DesiredNumberScheduled) - maxUnavailable expectedReady := int(ds.Status.DesiredNumberScheduled) - maxUnavailable
if !(int(ds.Status.NumberReady) >= expectedReady) { if !(int(ds.Status.NumberReady) >= expectedReady) {
slog.Info("DaemonSet is not ready: not enough pods ready", slog.Debug("DaemonSet is not ready: not enough pods ready",
"namespace", ds.Namespace, "namespace", ds.Namespace,
"name", ds.Name, "name", ds.Name,
"readyPods", ds.Status.NumberReady, "readyPods", ds.Status.NumberReady,
@ -398,7 +398,7 @@ func (c *ReadyChecker) crdReady(crd apiextv1.CustomResourceDefinition) bool {
func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool { func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
// Verify the generation observed by the statefulSet controller matches the spec generation // Verify the generation observed by the statefulSet controller matches the spec generation
if sts.Status.ObservedGeneration != sts.ObjectMeta.Generation { if sts.Status.ObservedGeneration != sts.ObjectMeta.Generation {
slog.Info("StatefulSet is not ready: observedGeneration does not match spec generation", slog.Debug("StatefulSet is not ready: observedGeneration does not match spec generation",
"namespace", sts.Namespace, "namespace", sts.Namespace,
"name", sts.Name, "name", sts.Name,
"observedGeneration", sts.Status.ObservedGeneration, "observedGeneration", sts.Status.ObservedGeneration,
@ -408,7 +408,7 @@ func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
// If the update strategy is not a rolling update, there will be nothing to wait for // If the update strategy is not a rolling update, there will be nothing to wait for
if sts.Spec.UpdateStrategy.Type != appsv1.RollingUpdateStatefulSetStrategyType { if sts.Spec.UpdateStrategy.Type != appsv1.RollingUpdateStatefulSetStrategyType {
slog.Info("StatefulSet skipped ready check", slog.Debug("StatefulSet skipped ready check",
"namespace", sts.Namespace, "namespace", sts.Namespace,
"name", sts.Name, "name", sts.Name,
"updateStrategy", sts.Spec.UpdateStrategy.Type) "updateStrategy", sts.Spec.UpdateStrategy.Type)
@ -437,7 +437,7 @@ func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
// Make sure all the updated pods have been scheduled // Make sure all the updated pods have been scheduled
if int(sts.Status.UpdatedReplicas) < expectedReplicas { if int(sts.Status.UpdatedReplicas) < expectedReplicas {
slog.Info("StatefulSet is not ready: not enough pods scheduled", slog.Debug("StatefulSet is not ready: not enough pods scheduled",
"namespace", sts.Namespace, "namespace", sts.Namespace,
"name", sts.Name, "name", sts.Name,
"updatedReplicas", sts.Status.UpdatedReplicas, "updatedReplicas", sts.Status.UpdatedReplicas,
@ -446,7 +446,7 @@ func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
} }
if int(sts.Status.ReadyReplicas) != replicas { if int(sts.Status.ReadyReplicas) != replicas {
slog.Info("StatefulSet is not ready: not enough pods ready", slog.Debug("StatefulSet is not ready: not enough pods ready",
"namespace", sts.Namespace, "namespace", sts.Namespace,
"name", sts.Name, "name", sts.Name,
"readyReplicas", sts.Status.ReadyReplicas, "readyReplicas", sts.Status.ReadyReplicas,
@ -457,7 +457,7 @@ func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
// partitioned rolling upgrade, this condition will never evaluate to true, leading to // partitioned rolling upgrade, this condition will never evaluate to true, leading to
// error. // error.
if partition == 0 && sts.Status.CurrentRevision != sts.Status.UpdateRevision { if partition == 0 && sts.Status.CurrentRevision != sts.Status.UpdateRevision {
slog.Info("StatefulSet is not ready: currentRevision does not match updateRevision", slog.Debug("StatefulSet is not ready: currentRevision does not match updateRevision",
"namespace", sts.Namespace, "namespace", sts.Namespace,
"name", sts.Name, "name", sts.Name,
"currentRevision", sts.Status.CurrentRevision, "currentRevision", sts.Status.CurrentRevision,
@ -465,7 +465,7 @@ func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
return false return false
} }
slog.Info("StatefulSet is ready", slog.Debug("StatefulSet is ready",
"namespace", sts.Namespace, "namespace", sts.Namespace,
"name", sts.Name, "name", sts.Name,
"readyReplicas", sts.Status.ReadyReplicas, "readyReplicas", sts.Status.ReadyReplicas,
@ -476,7 +476,7 @@ func (c *ReadyChecker) statefulSetReady(sts *appsv1.StatefulSet) bool {
func (c *ReadyChecker) replicationControllerReady(rc *corev1.ReplicationController) bool { func (c *ReadyChecker) replicationControllerReady(rc *corev1.ReplicationController) bool {
// Verify the generation observed by the replicationController controller matches the spec generation // Verify the generation observed by the replicationController controller matches the spec generation
if rc.Status.ObservedGeneration != rc.ObjectMeta.Generation { if rc.Status.ObservedGeneration != rc.ObjectMeta.Generation {
slog.Info("ReplicationController is not ready: observedGeneration does not match spec generation", slog.Debug("ReplicationController is not ready: observedGeneration does not match spec generation",
"namespace", rc.Namespace, "namespace", rc.Namespace,
"name", rc.Name, "name", rc.Name,
"observedGeneration", rc.Status.ObservedGeneration, "observedGeneration", rc.Status.ObservedGeneration,
@ -489,7 +489,7 @@ func (c *ReadyChecker) replicationControllerReady(rc *corev1.ReplicationControll
func (c *ReadyChecker) replicaSetReady(rs *appsv1.ReplicaSet) bool { func (c *ReadyChecker) replicaSetReady(rs *appsv1.ReplicaSet) bool {
// Verify the generation observed by the replicaSet controller matches the spec generation // Verify the generation observed by the replicaSet controller matches the spec generation
if rs.Status.ObservedGeneration != rs.ObjectMeta.Generation { if rs.Status.ObservedGeneration != rs.ObjectMeta.Generation {
slog.Info("ReplicaSet is not ready: observedGeneration does not match spec generation", slog.Debug("ReplicaSet is not ready: observedGeneration does not match spec generation",
"namespace", rs.Namespace, "namespace", rs.Namespace,
"name", rs.Name, "name", rs.Name,
"observedGeneration", rs.Status.ObservedGeneration, "observedGeneration", rs.Status.ObservedGeneration,

Loading…
Cancel
Save