Skip to content

Commit

Permalink
feat: pull kaniko images from private registry w/ pull secret
Browse files Browse the repository at this point in the history
  • Loading branch information
dherges committed Jan 5, 2024
1 parent 8f18c02 commit 2f3433f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/skaffold/build/cluster/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ func (b *Builder) kanikoPodSpec(artifact *latest.KanikoArtifact, tag string, pla
addSecretVolume(pod, kaniko.DefaultSecretName, b.ClusterDetails.PullSecretMountPath, b.ClusterDetails.PullSecretName)
}

// Add secret for pulling kaniko images from a private registry
if artifact.ImagePullSecret != "" {
pod.Spec.ImagePullSecrets = []v1.LocalObjectReference{{
Name: artifact.ImagePullSecret,
}}
}

// Add host path volume for cache
if artifact.Cache != nil && artifact.Cache.HostPath != "" {
addHostPathVolume(pod, kaniko.DefaultCacheDirName, kaniko.DefaultCacheDirMountPath, artifact.Cache.HostPath)
Expand Down

0 comments on commit 2f3433f

Please sign in to comment.