Skip to content

Commit

Permalink
add log to debug.
Browse files Browse the repository at this point in the history
Signed-off-by: yy <[email protected]>
  • Loading branch information
lingdie committed Sep 4, 2024
1 parent 980e796 commit 99001a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/devbox/internal/controller/devbox_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,17 @@ func (r *DevboxReconciler) syncPod(ctx context.Context, devbox *devboxv1alpha1.D
return r.updateDevboxCommitHistory(ctx, devbox, &podList.Items[0])
}
if !helper.CheckPodConsistency(expectPod, &podList.Items[0]) {
logger.Info("pod is pending, but pod spec is not consistent, delete pod")
logger.Info("pod", "pod", podList.Items[0].Name, "pod spec", podList.Items[0].Spec)
logger.Info("expect pod", "pod", expectPod.Name, "pod spec", expectPod.Spec)
_ = r.Delete(ctx, &podList.Items[0])
}
case corev1.PodRunning:
//if pod is running,check pod need restart
if !helper.CheckPodConsistency(expectPod, &podList.Items[0]) {
logger.Info("pod is running, but pod spec is not consistent, delete pod")
logger.Info("pod", "pod", podList.Items[0].Name, "pod spec", podList.Items[0].Spec)
logger.Info("expect pod", "pod", expectPod.Name, "pod spec", expectPod.Spec)
_ = r.Delete(ctx, &podList.Items[0])
}
return r.updateDevboxCommitHistory(ctx, devbox, &podList.Items[0])
Expand Down

0 comments on commit 99001a8

Please sign in to comment.