Skip to content

Commit 0465dc1

Browse files
Merge pull request #337 from kstrenkova/fix-ansible-workload-ssh-key
Fix empty AnsibleTest workload key
2 parents 2b28133 + e76d634 commit 0465dc1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

pkg/ansibletest/volumes.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,19 @@ func GetVolumes(
9393

9494
volumes = append(volumes, keysVolume)
9595

96-
keysVolume = corev1.Volume{
97-
Name: "workload-ssh-secret",
98-
VolumeSource: corev1.VolumeSource{
99-
Secret: &corev1.SecretVolumeSource{
100-
SecretName: workflowOverrideParams["WorkloadSSHKeySecretName"],
101-
DefaultMode: &privateKeyMode,
96+
if workflowOverrideParams["WorkloadSSHKeySecretName"] != "" {
97+
keysVolume = corev1.Volume{
98+
Name: "workload-ssh-secret",
99+
VolumeSource: corev1.VolumeSource{
100+
Secret: &corev1.SecretVolumeSource{
101+
SecretName: workflowOverrideParams["WorkloadSSHKeySecretName"],
102+
DefaultMode: &privateKeyMode,
103+
},
102104
},
103-
},
104-
}
105+
}
105106

106-
volumes = append(volumes, keysVolume)
107+
volumes = append(volumes, keysVolume)
108+
}
107109

108110
for _, exv := range instance.Spec.ExtraMounts {
109111
for _, vol := range exv.Propagate(svc) {

0 commit comments

Comments
 (0)