Skip to content

Commit 36eaf3e

Browse files
Merge pull request #4403 from pmtk/healthcheck-duration-log
USHIFT-5280: microshift healthcheck - include timeout duration in the logs
2 parents d177282 + f7add39 commit 36eaf3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/healthcheck/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func microshiftServiceShouldBeOk(ctx context.Context, timeout time.Duration) (bo
2828
}
2929
klog.Info("microshift.service is enabled")
3030

31-
klog.Info("Waiting for microshift.service to be ready")
31+
klog.Infof("Waiting %v for microshift.service to be ready", timeout)
3232
if err := wait.PollUntilContextTimeout(ctx, time.Second, timeout, true, func(ctx context.Context) (done bool, err error) {
3333
return systemd.IsServiceActiveAndNotFailed(ctx, "microshift.service")
3434
}); err != nil {

pkg/healthcheck/workloads.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func waitForWorkloads(ctx context.Context, timeout time.Duration, workloads map[
5555
}
5656

5757
func waitForDaemonSet(ctx context.Context, client *appsclientv1.AppsV1Client, timeout time.Duration, namespace, name string) error {
58-
klog.Infof("Waiting for daemonset/%s in %s", name, namespace)
58+
klog.Infof("Waiting %v for daemonset/%s in %s", timeout, name, namespace)
5959
err := wait.PollUntilContextTimeout(ctx, 10*time.Second, timeout, true, func(ctx context.Context) (done bool, err error) {
6060
ds, err := client.DaemonSets(namespace).Get(ctx, name, v1.GetOptions{})
6161
if err != nil {
@@ -91,7 +91,7 @@ func waitForDaemonSet(ctx context.Context, client *appsclientv1.AppsV1Client, ti
9191
}
9292

9393
func waitForDeployment(ctx context.Context, client *appsclientv1.AppsV1Client, timeout time.Duration, namespace, name string) error {
94-
klog.Infof("Waiting for deployment/%s in %s", name, namespace)
94+
klog.Infof("Waiting %v for deployment/%s in %s", timeout, name, namespace)
9595
err := wait.PollUntilContextTimeout(ctx, 10*time.Second, timeout, true, func(ctx context.Context) (done bool, err error) {
9696
deployment, err := client.Deployments(namespace).Get(ctx, name, v1.GetOptions{})
9797
if err != nil {
@@ -134,7 +134,7 @@ func waitForDeployment(ctx context.Context, client *appsclientv1.AppsV1Client, t
134134
}
135135

136136
func waitForStatefulSet(ctx context.Context, client *appsclientv1.AppsV1Client, timeout time.Duration, namespace, name string) error {
137-
klog.Infof("Waiting for statefulset/%s in %s", name, namespace)
137+
klog.Infof("Waiting %v for statefulset/%s in %s", timeout, name, namespace)
138138
err := wait.PollUntilContextTimeout(ctx, 10*time.Second, timeout, true, func(ctx context.Context) (done bool, err error) {
139139
sts, err := client.StatefulSets(namespace).Get(ctx, name, v1.GetOptions{})
140140
if err != nil {

0 commit comments

Comments
 (0)