Repository navigation
rstudio-workbench: set imagePullPolicy on launcher init containers - #958
Merged
Merged
Conversation
Init containers added by the launcher had no imagePullPolicy, so Kubernetes defaulted to IfNotPresent. The Positron preview init image (ghcr.io/posit-dev/workbench-positron-init-preview:daily) therefore went stale on each node after its first pull. Images tagged :daily or :latest now always use Always. Other init containers use the new launcher.templateValues.pod.initContainerImagePullPolicy value when set; empty keeps the Kubernetes default. Fixes #949
ssinnott
approved these changes
Oct 5, 2026
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.
Fixes #949
Summary
The
.Job.initContainersloop infiles/job.tplemitted noimagePullPolicy, so Kubernetes defaulted toIfNotPresentfor any non-:latesttag. Withlauncher-positron-preview-init-container-enabled, the Positron preview init image (ghcr.io/posit-dev/workbench-positron-init-preview:daily) was pulled once per node and then reused indefinitely, so different nodes served different (and stale) preview builds.Changes
files/job.tpl: for launcher-provided init containers::dailyor:latestgetimagePullPolicy: Always;launcher.templateValues.pod.initContainerImagePullPolicyis emitted if set;values.yaml: newlauncher.templateValues.pod.initContainerImagePullPolicy: "".The rule keys off the image tag rather than off whether preview is enabled: the template only sees the resulting image string, and a chart-wide switch would force
Alwaysonto pinned images for no benefit.# Version:injob.tplis unchanged; it tracks the upstream launcher template version, and chart-side edits tojob.tplhave not bumped it.Testing
make lintpasses;just test rstudio-workbenchpasses (173 tests).lint/scenarios onmainand on this branch: the only differences are the newjob.tpllines, the new key in the template-values JSON, and the resultingchecksum/config-generalannotations.job.tplagainst sample init containers (...-preview:daily,foo:latest,posit/workbench-session-init:2026.09.0):Always,Always, unsetIfNotPresent:Always,Always,IfNotPresentNever:Always,Always,NeverOut of scope
This covers
launcher.useTemplatesonly. Without templates, the Kubernetes launcher builds the pod itself and Workbench's launcherInitContainerhas no pull-policy field, so a complete fix needs a Workbench change (see the issue).