Skip to content

Commit 1b64876

Browse files
Merge pull request #1063 from ashu-011/swift_fix
Add Storagemgmt network attachment to Swift CR
2 parents 4ae44f5 + a93730c commit 1b64876

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

tests/roles/swift_adoption/defaults/main.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ swift_patch: |
1111
swiftStorage:
1212
replicas: 0
1313
networkAttachments:
14-
- storage
14+
- storage
15+
{% if storagemgmt_available | default(false) -%}
16+
- storagemgmt
17+
{%- endif %}
18+
1519
storageClass: {{ storage_class_name }}
1620
storageRequest: 10Gi
1721
swiftProxy:
@@ -36,5 +40,9 @@ swift_patch: |
3640
spec:
3741
type: LoadBalancer
3842
networkAttachments:
39-
- storage
43+
- storage
44+
{% if storagemgmt_available | default(false) -%}
45+
- storagemgmt
46+
{%- endif %}
47+
4048
swift_retry_delay: 5

tests/roles/swift_adoption/tasks/main.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@
3030
object.ring.gz: $($CONTROLLER1_SSH "base64 -w0 /var/lib/config-data/puppet-generated/swift/etc/swift/object.ring.gz")
3131
EOF
3232
33+
- name: Check if storagemgmt NetworkAttachmentDefinition exists
34+
ansible.builtin.shell: |
35+
{{ shell_header }}
36+
{{ oc_header }}
37+
oc get network-attachment-definitions storagemgmt
38+
register: storagemgmt_nad_check
39+
failed_when: false
40+
41+
- name: Set storagemgmt_available variable
42+
ansible.builtin.set_fact:
43+
storagemgmt_available: "{{ storagemgmt_nad_check.rc == 0 }}"
44+
45+
- name: Debug storagemgmt availability
46+
ansible.builtin.debug:
47+
msg: "storagemgmt NetworkAttachmentDefinition available: {{ storagemgmt_available }}"
48+
3349
- name: Deploy podified Swift
3450
ansible.builtin.shell: |
3551
{{ shell_header }}

0 commit comments

Comments
 (0)