zfs-localpv/e2e-tests/utils/k8s/pre_create_app_deploy.yml
Aman Gupta 4e73638b5a
feat(e2e-test): Add e2e-tests for zfs-localpv (#298)
Signed-off-by: w3aman <aman.gupta@mayadata.io>
2021-06-09 21:21:39 +05:30

40 lines
1.3 KiB
YAML

---
- block:
- name: Check whether the provider storageclass is present
shell: kubectl get sc "{{ lookup('env','STORAGE_CLASS') }}"
args:
executable: /bin/bash
register: result
failed_when: "result.rc != 0"
- name: Replace the storageclass placeholder with test specific value
replace:
path: "{{ application }}"
regexp: "testclass"
replace: "{{ lookup('env','STORAGE_CLASS') }}"
- name: Replace the application pvc placeholder with test specific value
replace:
path: "{{ application }}"
regexp: "testclaim"
replace: "{{ lookup('env','APP_PVC') }}"
- name: Replace the persistent volume capcity placeholder with test specific value
replace:
path: "{{ application }}"
regexp: "teststorage"
replace: "{{ lookup('env','PV_CAPACITY') }}"
- name: Get the application label value from env
set_fact:
app_lkey: "{{ app_label.split('=')[0] }}"
app_lvalue: "{{ app_label.split('=')[1] }}"
- name: Replace the application label placeholder in deployment spec
replace:
path: "{{ application }}"
regexp: "lkey: lvalue"
replace: "{{ app_lkey }}: {{ app_lvalue }}"
# Create test specific namespace
- include_tasks: /e2e-tests/utils/k8s/create_ns.yml