Skip to content

Commit

Permalink
add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobGros committed Feb 23, 2024
1 parent a7fbbe5 commit 0ecb8ba
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pkg/utils/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,11 +667,13 @@ func appMobStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageModu
}

checkFn := func(deployment *appsv1.Deployment) bool {
log.Infof("Deployment: %s has %s ready replicas and %s replicas", deployment.Name, deployment.Status.ReadyReplicas, deployment.Spec.Replicas)
return deployment.Status.ReadyReplicas == *deployment.Spec.Replicas
}

for _, deployment := range deploymentList.Items {
deployment := deployment
log.Infof("Checking deployment: %s", deployment.Name)
switch deployment.Name {
case "cert-manager":
if certEnabled {
Expand Down Expand Up @@ -707,9 +709,10 @@ func appMobStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageModu
return false, err
}

log.Info("podList: %+v\n", podList)
//log.Info("podList: %+v\n", podList)

for _, pod := range podList.Items {
log.Infof("Checking Daemonset pod: %s", pod.Name)
if pod.Status.Phase == corev1.PodRunning {
readyPods++
} else {
Expand All @@ -723,6 +726,17 @@ func appMobStatusCheck(ctx context.Context, instance *csmv1.ContainerStorageModu
daemonRunning = true
}

log.Infof("readyPods: %s", readyPods)
log.Infof("notreadyPods: %s", notreadyPods)
log.Infof("certEnabled: %s", certEnabled)
log.Infof("veleroEnabled: %s", veleroEnabled)
log.Infof("certManagerRunning: %s", certManagerRunning)
log.Infof("certManagerCainInjectorRunning: %s", certManagerCainInjectorRunning)
log.Infof("certManagerWebhookRunning: %s", certManagerWebhookRunning)
log.Infof("veleroRunning: %s", veleroRunning)
log.Infof("daemonRunning: %s", daemonRunning)


if certEnabled && veleroEnabled {
return appMobRunning && certManagerRunning && certManagerCainInjectorRunning && certManagerWebhookRunning && veleroRunning && daemonRunning, nil
}
Expand Down

0 comments on commit 0ecb8ba

Please sign in to comment.