summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShelley-BaoYue <baoyue2@huawei.com>2024-03-25 15:44:19 +0800
committerShelley-BaoYue <baoyue2@huawei.com>2024-03-26 19:41:16 +0800
commitc62855a70ac9cc2aaeb23481b8512c7b79eba6d6 (patch)
treedf102e4761d103caa174ca262db4d18dff731e26
parentMerge pull request #5487 from Shelley-BaoYue/automated-cherry-pick-of-#5485-u... (diff)
downloadkubeedge-c62855a70ac9cc2aaeb23481b8512c7b79eba6d6.tar.gz
fix retrytimes in imageprepulljob
Signed-off-by: Shelley-BaoYue <baoyue2@huawei.com>
-rw-r--r--build/crd-samples/operations/imageprepulljob.yaml4
-rw-r--r--edge/pkg/edgehub/task/taskexecutor/image_prepull.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/build/crd-samples/operations/imageprepulljob.yaml b/build/crd-samples/operations/imageprepulljob.yaml
index 940a99975..041e83d26 100644
--- a/build/crd-samples/operations/imageprepulljob.yaml
+++ b/build/crd-samples/operations/imageprepulljob.yaml
@@ -10,5 +10,5 @@ spec:
- busybox:latest
nodes:
- edgenode1 # Need to replaced with your own node name
- timeoutSecondsOnEachNode: 300
- retryTimes: 1 \ No newline at end of file
+ timeoutSeconds: 300
+ retryTimes: 1
diff --git a/edge/pkg/edgehub/task/taskexecutor/image_prepull.go b/edge/pkg/edgehub/task/taskexecutor/image_prepull.go
index a2b19c8e7..86da16e6b 100644
--- a/edge/pkg/edgehub/task/taskexecutor/image_prepull.go
+++ b/edge/pkg/edgehub/task/taskexecutor/image_prepull.go
@@ -137,7 +137,7 @@ func prePullImages(prePullReq commontypes.ImagePrePullJobRequest, container util
prePullStatus := v1alpha1.ImageStatus{
Image: image,
}
- for i := 0; i < int(prePullReq.RetryTimes); i++ {
+ for i := 0; i <= int(prePullReq.RetryTimes); i++ {
err = container.PullImage(image, authConfig, nil)
if err == nil {
break