fix: default imagePullPolicy to IfNotPresent for air-gapped environments#95
Merged
Iamlovingit merged 1 commit intoYuan-lab-LLM:mainfrom Apr 27, 2026
Conversation
Kubernetes defaults imagePullPolicy to Always when the image tag is :latest. This causes pod creation failures in air-gapped and enterprise environments where nodes cannot reach external registries. Changes: - Add ImagePullPolicy field to PodConfig struct - Default to IfNotPresent in CreatePod when not explicitly set - Support IMAGE_PULL_POLICY env var for operator override - Apply policy to both CreateInstance and StartInstance paths Closes Yuan-lab-LLM#94
Collaborator
|
/lgtm |
Collaborator
|
@hippoley Thanks for your contributions ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #94 — Pods fail to start in air-gapped / enterprise environments because Kubernetes defaults
imagePullPolicytoAlwaysfor images tagged:latest.Root Cause
defaultSystemImageSettings["openclaw"]resolves toghcr.io/yuan-lab-llm/clawmanager-openclaw-image/openclaw:latest. When no explicitimagePullPolicyis set on the container spec, Kubernetes applies its default rule::latesttag →Always. Nodes in air-gapped networks cannot reachghcr.io, so the pod stays inImagePullBackOff.Changes
pod_service.goImagePullPolicyfield toPodConfig; default toIfNotPresentinCreatePodinstance_runtime.godefaultImagePullPolicy()— readsIMAGE_PULL_POLICYenv var, falls back toIfNotPresentinstance_service.goImagePullPolicyin bothCreateInstanceandStartInstancepod config pathsinstance_runtime_test.goOperator Configuration
Set the
IMAGE_PULL_POLICYenvironment variable on the backend deployment to override the default:Impact
:latesttags (K8s already defaults toIfNotPresent). For:latesttags, operators can setIMAGE_PULL_POLICY=Alwaysto restore the previous behavior.ImagePullPolicyis an additive struct field; callers that omit it get the safe default.Testing
defaultImagePullPolicy()