Skip to content

Commit aae2bf5

Browse files
committed
Skip with empty image and change attempt duration
1 parent cd72fd7 commit aae2bf5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/service-waiter/cmd/component.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ var componentCmd = &cobra.Command{
3838
},
3939
Run: func(cmd *cobra.Command, args []string) {
4040
if componentCmdOpt.image == "" {
41-
log.Fatal("Target image should be defined")
41+
log.Errorf("target image is empty, skip service waiter")
42+
return
4243
}
4344
timeout := getTimeout()
4445
log.WithField("timeout", timeout.String()).WithFields(logrus.Fields{"image": componentCmdOpt.image, "component": componentCmdOpt.component, "namespace": componentCmdOpt.namespace, "labels": componentCmdOpt.labels}).Info("start to wait component")
@@ -109,13 +110,13 @@ func waitPodsImage(ctx context.Context) error {
109110
ok, err := checkPodsImage(ctx, k8sClient)
110111
if err != nil {
111112
log.WithError(err).Error("image check failed")
112-
time.Sleep(5 * time.Second)
113+
time.Sleep(1 * time.Second)
113114
continue
114115
}
115116
if ok {
116117
return nil
117118
}
118-
time.Sleep(5 * time.Second)
119+
time.Sleep(1 * time.Second)
119120
}
120121
}
121122
}

0 commit comments

Comments
 (0)