Skip to content

Commit e54383e

Browse files
michal-gubrickyjschoonechess-knight
authored
🐛 Adjust e2e test after the repo structure has changed (#134)
* Adjust e2e test after the repo structure has changed Signed-off-by: michal.gubricky <[email protected]> Increase delay between retries for kcp name Signed-off-by: michal.gubricky <[email protected]> Change default images in values.yaml Signed-off-by: michal.gubricky <[email protected]> Add debug logs from capi pod Signed-off-by: michal.gubricky <[email protected]> * fix(zuul): use default sonobuoy mode for full test Signed-off-by: Jan Schoone <[email protected]> * Update .zuul.yaml Signed-off-by: Jan Schoone <[email protected]> * Rename machineDeployment to 'default-worker' Signed-off-by: Roman Hros <[email protected]> --------- Signed-off-by: michal.gubricky <[email protected]> Signed-off-by: Jan Schoone <[email protected]> Signed-off-by: Roman Hros <[email protected]> Co-authored-by: Jan Schoone <[email protected]> Co-authored-by: Roman Hros <[email protected]>
1 parent ddfb876 commit e54383e

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

.zuul.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
parent: openstack-e2e-abstract
2626
description: |
2727
Run e2e tests of cluster-stacks project using
28-
[sonobuoy](https://sonobuoy.io/) with mode conformance and
28+
[sonobuoy](https://sonobuoy.io/) with mode non-disruptive conformance and
2929
SCS compliance checks meaning it will test if the Kubernetes
3030
cluster is conformant to the CNCF and to the SCS.
3131
timeout: 10800 # 3h
3232
vars:
3333
wait_for_cluster: 1200 # 20min
3434
sonobouy:
3535
enabled: true
36-
mode: conformance
36+
mode: certified-conformance
3737
scs_compliance:
3838
enabled: true
3939

playbooks/openstack/e2e.yaml

+23-10
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
- name: Cluster stack OpenStack E2E test
33
hosts: all
44
vars:
5-
cluster_stack: "providers/openstack/alpha/1-29"
6-
cluster_stack_name: "openstack-alpha-1-29"
7-
cluster_stack_version_name: alpha
5+
cluster_stack_path: "providers/openstack/scs"
86
project_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
97
cluster_stack_release_dir: "{{ ansible_user_dir }}/.release"
108
cluster_manifest_dir: "{{ ansible_user_dir }}/cluster_manifest"
@@ -39,19 +37,18 @@
3937
ansible.builtin.set_fact:
4038
zuul_config: "{{ zuul_config | first | split('/n') | map('trim') | join('\n') }}"
4139
when: zuul_config is defined and zuul_config is not none and zuul_config != ''
42-
- name: Extract cluster stack from Zuul config
40+
- name: Extract cluster_stack_folder from Zuul config
4341
ansible.builtin.set_fact:
44-
cluster_stack_name: "{{ zuul_config | regex_search('cluster_stack\\s*=\\s*\"([^\"]+)\"', '\\1') | first }}"
42+
cluster_stack_folder: "{{ zuul_config | regex_search('cluster_stack_folder\\s*=\\s*\"([^\"]+)\"', '\\1') | first }}"
4543
when:
4644
- zuul_config is defined and zuul_config is not none and zuul_config != ''
4745
- zuul_config | regex_search('cluster_stack\\s*=\\s*\"([^\"]+)\"') is defined
48-
- name: Override cluster stack if extracted
46+
- name: Override cluster_stack_path if the cluster_stack_folder extracted
4947
ansible.builtin.set_fact:
50-
cluster_stack: "{{ cluster_stack_name | regex_replace('^openstack-([a-zA-Z0-9]+)-([0-9]+-[0-9]+)$', 'providers/openstack/\\1/\\2') }}"
51-
cluster_stack_version_name: "{{ cluster_stack_name | regex_replace('^openstack-([a-zA-Z0-9]+)-([0-9]+-[0-9]+)$', '\\1') }}"
52-
when: cluster_stack_name is defined
48+
cluster_stack_path: "providers/openstack/{{ cluster_stack_folder }}"
49+
when: cluster_stack_folder is defined
5350
- name: Create cluster stack
54-
ansible.builtin.command: "csctl create {{ project_dir }}/{{ cluster_stack }} --output {{ cluster_stack_release_dir }} --mode hash"
51+
ansible.builtin.command: "csctl create {{ project_dir }}/{{ cluster_stack_path }} --output {{ cluster_stack_release_dir }} --mode hash"
5552
args:
5653
chdir: "{{ project_dir }}"
5754
changed_when: true
@@ -126,6 +123,22 @@
126123
ansible.builtin.set_fact:
127124
k8s_version_major_minor: "{{ k8s_version | regex_replace('^v?([0-9]+\\.[0-9]+)\\..*', '\\1') }}"
128125
when: k8s_version is defined
126+
- name: Read the csctl.yaml file
127+
ansible.builtin.slurp:
128+
src: "{{ project_dir }}/{{ cluster_stack_path }}/csctl.yaml"
129+
register: csctl_file_content
130+
- name: Parse the csctl.yaml content
131+
ansible.builtin.set_fact:
132+
csctl_data: "{{ csctl_file_content.content | b64decode | from_yaml }}"
133+
- name: Register cluster_stack_version_name
134+
ansible.builtin.set_fact:
135+
cluster_stack_version_name: "{{ csctl_data.config.clusterStackName }}"
136+
- name: Format the kubernetesVersion for cluster_stack_name
137+
ansible.builtin.set_fact:
138+
k8s_version_formatted: "{{ k8s_version_major_minor | regex_replace('\\.', '-') }}"
139+
- name: Create the cluster_stack_name
140+
ansible.builtin.set_fact:
141+
cluster_stack_name: "{{ csctl_data.config.provider.type }}-{{ csctl_data.config.clusterStackName }}-{{ k8s_version_formatted }}"
129142
- name: Extract cloud name from clouds_yaml_full
130143
ansible.builtin.set_fact:
131144
cloud_name: "{{ clouds_yaml_full.clouds.keys() | first }}"

playbooks/openstack/templates/cluster.yaml.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
version: {{ k8s_version }}
3636
workers:
3737
machineDeployments:
38-
- class: {{ cluster_stack_name }}-{{ cluster_stack_version }}
38+
- class: default-worker
3939
failureDomain: nova
4040
name: {{ cluster_stack_name }}
4141
replicas: 3

0 commit comments

Comments
 (0)