Skip to content

Commit 1875288

Browse files
committed
Making powervc-certificate optional
Signed-off-by: ira-pandey1 <ira.pandey1@ibm.com>
1 parent f78251e commit 1875288

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

playbooks/roles/ocp-csi-driver/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ Requirements
1515

1616
- Running OCP 4.x cluster is needed.
1717
- Cluster must not contain default StorageClass.
18-
- A secret with PowerVC certificate in the `default` namespace.
19-
Secret name must be `powervc-certificate` and must contains `certificate` field.
18+
- Optional :
19+
- A secret with PowerVC certificate in the `default` namespace
20+
Secret name should be `powervc-certificate` and must contains `certificate` field.
2021
eg.
2122

2223
```

playbooks/roles/ocp-csi-driver/tasks/main.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,22 @@
117117
name: powervc-certificate
118118
namespace: default
119119
register: powervc_certificate
120+
ignore_errors: yes
120121

121-
- name: Fail if the powervc-certificate does not exists in default namespace
122-
fail:
122+
- name: If the powervc-certificate does not exists in default namespace
123+
debug:
123124
msg: "PowerVC certificate secret is not present!"
124125
when: powervc_certificate.resources | length == 0
125126

126-
- fail:
127+
- name: Debug if the PowerVC certificate is empty or missing
128+
debug:
127129
msg: "PowerVC certificate is empty! Please check the certificate's secret."
128-
when: >
129-
(powervc_certificate.resources[0].data.certificate is not defined) or
130-
(powervc_certificate.resources[0].data.certificate | length == 0)
130+
when:
131+
powervc_certificate.resources | length != 0 and
132+
(
133+
powervc_certificate.resources[0].data.certificate is not defined or
134+
powervc_certificate.resources[0].data.certificate | length == 0
135+
)
131136

132137
- name: Create namespace for CSI driver validation
133138
k8s:

0 commit comments

Comments
 (0)