File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,15 @@ func InjectPluginSidecarPodSpec(
336336 if spec .Containers [i ].Name == mainContainerName {
337337 volumeMounts = spec .Containers [i ].VolumeMounts
338338 mainContainerFound = true
339- } else if spec .Containers [i ].Name == sidecar .Name {
339+ }
340+ }
341+
342+ if ! mainContainerFound {
343+ return errors .New ("main container not found" )
344+ }
345+
346+ for i := range spec .InitContainers {
347+ if spec .InitContainers [i ].Name == sidecar .Name {
340348 sidecarContainerFound = true
341349 }
342350 }
@@ -346,10 +354,6 @@ func InjectPluginSidecarPodSpec(
346354 return nil
347355 }
348356
349- if ! mainContainerFound {
350- return errors .New ("main container not found" )
351- }
352-
353357 // Do not modify the passed sidecar definition
354358 if injectMainContainerVolumes {
355359 sidecar .VolumeMounts = append (sidecar .VolumeMounts , volumeMounts ... )
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ MYTMPDIR="$(mktemp -d)"
1313trap ' rm -rf -- "$MYTMPDIR"' EXIT
1414
1515current_context=$( kubectl config view --raw -o json | jq -r ' ."current-context"' | sed " s/kind-//" )
16- operator_image=$( KIND_CLUSTER_NAME=" $current_context " KO_DOCKER_REPO=kind.local ko build -BP ./cmd/operator )
17- instance_image=$( KIND_CLUSTER_NAME=" $current_context " KO_DOCKER_REPO=kind.local KO_DEFAULTBASEIMAGE=" ghcr.io/cloudnative-pg/postgresql:17.0" ko build -BP ./cmd/instance )
16+ operator_image=$( KIND_CLUSTER_NAME=" $current_context " KO_DOCKER_REPO=kind.local ko build -BP ./cmd/manager )
17+ instance_image=$( KIND_CLUSTER_NAME=" $current_context " KO_DOCKER_REPO=kind.local KO_DEFAULTBASEIMAGE=" ghcr.io/cloudnative-pg/postgresql:17.0" ko build -BP ./cmd/manager )
1818
1919# Now we deploy the plugin inside the `cnpg-system` workspace
2020(
You can’t perform that action at this time.
0 commit comments