Skip to content

Commit 25b0b1d

Browse files
committed
Fix the nil pointing issue
When a workflow is set without ExtraConfigMap in ansible controller the pod won't be able to start because the pointer won't be pointing at nothing. Changed the condition to allow avoiding this issue. Jira: https://issues.redhat.com/browse/OSPRH-11191
1 parent 06ff0ea commit 25b0b1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/ansibletest/volumes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func GetVolumes(
106106
volumes = append(volumes, extraVol)
107107
}
108108

109-
if len(instance.Spec.Workflow) > 0 {
109+
if len(*instance.Spec.Workflow[externalWorkflowCounter].ExtraConfigmapsMounts) > 0 {
110110
for _, vol := range *instance.Spec.Workflow[externalWorkflowCounter].ExtraConfigmapsMounts {
111111
extraWorkflowVol := corev1.Volume{
112112
Name: vol.Name,
@@ -204,7 +204,7 @@ func GetVolumeMounts(mountCerts bool, instance *testv1beta1.AnsibleTest, externa
204204
volumeMounts = append(volumeMounts, extraConfigmapsMounts)
205205
}
206206

207-
if len(instance.Spec.Workflow) > 0 {
207+
if len(*instance.Spec.Workflow[externalWorkflowCounter].ExtraConfigmapsMounts) > 0 {
208208
for _, vol := range *instance.Spec.Workflow[externalWorkflowCounter].ExtraConfigmapsMounts {
209209

210210
extraConfigmapsMounts := corev1.VolumeMount{

0 commit comments

Comments
 (0)