Skip to content

Commit

Permalink
Merge pull request #3969 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…3962-to-release-4.12

[release-4.12] OCPBUGS-20509: resolv-prepender: avoid pulling baremetalRuntimeCfgImage again if it …
  • Loading branch information
openshift-ci[bot] committed Oct 13, 2023
2 parents 0611c23 + e7ee160 commit b483cdd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions templates/common/on-prem/files/resolv-prepender.yaml
Expand Up @@ -18,9 +18,18 @@ contents:
{{end -}}
function pull_baremetal_runtime_cfg_image {
>&2 echo "NM resolv-prepender: Starting download of baremetal runtime cfg image"
while ! /usr/bin/podman pull --authfile /var/lib/kubelet/config.json {{ .Images.baremetalRuntimeCfgImage }}; do sleep 1; done
>&2 echo "NM resolv-prepender: Download of baremetal runtime cfg image completed"
# By default podman retries to pull an image 3 times with 1 second back-off. It is not configurable. For this
# reason we are implementing our own logic of pulling image and retrying indefinitely.
# Ref.: https://github.com/containers/common/blob/e028741ef77fdfa3ae261b9d23cdd50253d586c4/libimage/copier.go#L27-L30
>&2 echo "NM resolv-prepender: Checking if baremetal runtime cfg image already exists"
if ! /usr/bin/podman image exists {{ .Images.baremetalRuntimeCfgImage }}; then
>&2 echo "NM resolv-prepender: Starting download of baremetal runtime cfg image"
while ! /usr/bin/podman pull --authfile /var/lib/kubelet/config.json {{ .Images.baremetalRuntimeCfgImage }}; do sleep 1; done
>&2 echo "NM resolv-prepender: Download of baremetal runtime cfg image completed"
else
>&2 echo "NM resolv-prepender: Image exists, no need to download"
fi
}
function resolv_prepender {
Expand Down

0 comments on commit b483cdd

Please sign in to comment.