Skip to content

Commit

Permalink
fix(k8s): add imagePullSecret from kubernetes provider to sync init c…
Browse files Browse the repository at this point in the history
…ontainer (#6530)
  • Loading branch information
twelvemo authored Oct 10, 2024
1 parent 15fe974 commit 07a577e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/plugins/kubernetes/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import { gardenEnv } from "../../constants.js"
import { styles } from "../../logger/styles.js"
import { commandListToShellScript } from "../../util/escape.js"
import { toClearText } from "../../util/secrets.js"
import type { V1Container } from "@kubernetes/client-node"

export const builtInExcludes = ["/**/*.git", "**/*.garden"]

Expand Down Expand Up @@ -462,7 +463,7 @@ export async function configureSyncMode({
}
const k8sSyncUtilImageName = getK8sSyncUtilImageName()
if (!podSpec.initContainers.find((c) => c.image === k8sSyncUtilImageName)) {
const initContainer = {
const initContainer: V1Container = {
name: k8sSyncUtilContainerName,
image: k8sSyncUtilImageName,
command: [
Expand All @@ -475,6 +476,7 @@ export async function configureSyncMode({
volumeMounts: [gardenVolumeMount],
}
podSpec.initContainers.push(initContainer)
podSpec.imagePullSecrets = provider.config.imagePullSecrets
}

if (!targetContainer.volumeMounts) {
Expand Down

0 comments on commit 07a577e

Please sign in to comment.