@@ -13,7 +13,6 @@ func GetVolumes(
1313 logsPVCName string ,
1414 mountCerts bool ,
1515 svc []storage.PropagationType ,
16- workflowOverrideParams map [string ]string ,
1716 externalWorkflowCounter int ,
1817) []corev1.Volume {
1918
@@ -85,20 +84,20 @@ func GetVolumes(
8584 Name : "compute-ssh-secret" ,
8685 VolumeSource : corev1.VolumeSource {
8786 Secret : & corev1.SecretVolumeSource {
88- SecretName : workflowOverrideParams [ " ComputeSSHKeySecretName" ] ,
87+ SecretName : instance . Spec . ComputeSSHKeySecretName ,
8988 DefaultMode : & privateKeyMode ,
9089 },
9190 },
9291 }
9392
9493 volumes = append (volumes , keysVolume )
9594
96- if workflowOverrideParams [ " WorkloadSSHKeySecretName" ] != "" {
95+ if instance . Spec . WorkloadSSHKeySecretName != "" {
9796 keysVolume = corev1.Volume {
9897 Name : "workload-ssh-secret" ,
9998 VolumeSource : corev1.VolumeSource {
10099 Secret : & corev1.SecretVolumeSource {
101- SecretName : workflowOverrideParams [ " WorkloadSSHKeySecretName" ] ,
100+ SecretName : instance . Spec . WorkloadSSHKeySecretName ,
102101 DefaultMode : & privateKeyMode ,
103102 },
104103 },
@@ -219,14 +218,16 @@ func GetVolumeMounts(
219218 volumeMounts = append (volumeMounts , caCertVolumeMount )
220219 }
221220
222- workloadSSHKeyMount := corev1.VolumeMount {
223- Name : "workload-ssh-secret" ,
224- MountPath : "/var/lib/ansible/test_keypair.key" ,
225- SubPath : "ssh-privatekey" ,
226- ReadOnly : true ,
227- }
221+ if instance .Spec .WorkloadSSHKeySecretName != "" {
222+ workloadSSHKeyMount := corev1.VolumeMount {
223+ Name : "workload-ssh-secret" ,
224+ MountPath : "/var/lib/ansible/test_keypair.key" ,
225+ SubPath : "ssh-privatekey" ,
226+ ReadOnly : true ,
227+ }
228228
229- volumeMounts = append (volumeMounts , workloadSSHKeyMount )
229+ volumeMounts = append (volumeMounts , workloadSSHKeyMount )
230+ }
230231
231232 computeSSHKeyMount := corev1.VolumeMount {
232233 Name : "compute-ssh-secret" ,
0 commit comments