Skip to content

Commit

Permalink
Mount docker config secret
Browse files Browse the repository at this point in the history
  • Loading branch information
dzsak committed Mar 13, 2024
1 parent 5dc3954 commit 1377e60
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cmd/agent/imagebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,14 @@ func generateJob(trigger dx.ImageBuildRequest, name, sourceUrl string) *batchv1.
if !strings.HasPrefix(trigger.Image, "127.0.0.1:32447") {
job.Spec.Template.Spec.Containers[0].VolumeMounts = append(job.Spec.Template.Spec.Containers[0].VolumeMounts, corev1.VolumeMount{
MountPath: "/kaniko/.docker",
Name: "docker-config",
Name: "dockerconfig-secret",
})

job.Spec.Template.Spec.Volumes = append(job.Spec.Template.Spec.Volumes, corev1.Volume{
Name: "docker-config",
Name: "dockerconfig-secret",
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Name: "docker-config",
},
Secret: &corev1.SecretVolumeSource{
SecretName: "dockerconfig-secret",
},
},
})
Expand Down

0 comments on commit 1377e60

Please sign in to comment.