Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/core/v1beta1/connect_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,9 @@ func (c *Connect) CreateSessionVolumeFactory(ctx context.Context) *product.Multi
},
InitContainerDefs: map[string]*product.ContainerDef{
"init-runtime": {
Image: img,
ImagePullPolicy: corev1.PullAlways,
Image: img,
// PullIfNotPresent: tag is pinned to Connect version, so a cached copy is always correct.
ImagePullPolicy: corev1.PullIfNotPresent,
Mounts: map[string]*product.VolumeMountDef{
"init-volume": {
MountPath: "/mnt/rstudio-connect-runtime",
Expand Down
6 changes: 6 additions & 0 deletions api/core/v1beta1/connect_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Loading