From d746dc67c9679ab27fce940b48193c25fe7da1c8 Mon Sep 17 00:00:00 2001 From: Steve Nolen Date: Fri, 20 Nov 2026 12:59:54 -0500 Subject: [PATCH 1/2] fix: use IfNotPresent pull policy for Connect content-init container The Connect init-runtime init container on content pods was hardcoded to ImagePullPolicy: Always, so every content start made a live registry call to ghcr.io. A registry hiccup could then fail content starts cluster-wide with ImagePullBackOff even though the image was already cached on every node. The content-init tag is pinned to the Connect version, so switch it to IfNotPresent and add a unit test asserting the policy. --- api/core/v1beta1/connect_types.go | 7 +++++-- api/core/v1beta1/connect_types_test.go | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api/core/v1beta1/connect_types.go b/api/core/v1beta1/connect_types.go index 9388f1d..f2c03a3 100644 --- a/api/core/v1beta1/connect_types.go +++ b/api/core/v1beta1/connect_types.go @@ -928,8 +928,11 @@ func (c *Connect) CreateSessionVolumeFactory(ctx context.Context) *product.Multi }, InitContainerDefs: map[string]*product.ContainerDef{ "init-runtime": { - Image: img, - ImagePullPolicy: corev1.PullAlways, + Image: img, + // The content-init image tag is pinned to the Connect version, so a + // cached copy is always correct. PullAlways forced a registry call on + // every content start, failing starts cluster-wide on registry hiccups. + ImagePullPolicy: corev1.PullIfNotPresent, Mounts: map[string]*product.VolumeMountDef{ "init-volume": { MountPath: "/mnt/rstudio-connect-runtime", diff --git a/api/core/v1beta1/connect_types_test.go b/api/core/v1beta1/connect_types_test.go index 74f0170..50bb3bc 100644 --- a/api/core/v1beta1/connect_types_test.go +++ b/api/core/v1beta1/connect_types_test.go @@ -435,6 +435,12 @@ func TestConnect_CreateSessionVolumeFactory(t *testing.T) { env := v.EnvVars() assert.Len(t, env, 0) + // the init-runtime container should not force a registry pull on every start + initContainers := v.InitContainers() + assert.Len(t, initContainers, 1) + assert.Equal(t, "init-runtime", initContainers[0].Name) + assert.Equal(t, corev1.PullIfNotPresent, initContainers[0].ImagePullPolicy) + // and if you don't have a special secret env var con.Spec.SessionConfig = &product.SessionConfig{ Pod: &product.PodConfig{ From 58ed4de9a86ed4a1010474956e65399afe599d42 Mon Sep 17 00:00:00 2001 From: Steve Nolen Date: Fri, 20 Nov 2026 13:28:13 -0500 Subject: [PATCH 2/2] chore: condense content-init pull policy comment --- api/core/v1beta1/connect_types.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/core/v1beta1/connect_types.go b/api/core/v1beta1/connect_types.go index f2c03a3..1e4b4c7 100644 --- a/api/core/v1beta1/connect_types.go +++ b/api/core/v1beta1/connect_types.go @@ -929,9 +929,7 @@ func (c *Connect) CreateSessionVolumeFactory(ctx context.Context) *product.Multi InitContainerDefs: map[string]*product.ContainerDef{ "init-runtime": { Image: img, - // The content-init image tag is pinned to the Connect version, so a - // cached copy is always correct. PullAlways forced a registry call on - // every content start, failing starts cluster-wide on registry hiccups. + // PullIfNotPresent: tag is pinned to Connect version, so a cached copy is always correct. ImagePullPolicy: corev1.PullIfNotPresent, Mounts: map[string]*product.VolumeMountDef{ "init-volume": {