From e54383eb5dd5fc8925bad8d300d01b1294c49390 Mon Sep 17 00:00:00 2001 From: Michal Gubricky Date: Mon, 22 Jul 2024 15:36:07 +0200 Subject: [PATCH] :bug: Adjust e2e test after the repo structure has changed (#134) * Adjust e2e test after the repo structure has changed Signed-off-by: michal.gubricky Increase delay between retries for kcp name Signed-off-by: michal.gubricky Change default images in values.yaml Signed-off-by: michal.gubricky Add debug logs from capi pod Signed-off-by: michal.gubricky * fix(zuul): use default sonobuoy mode for full test Signed-off-by: Jan Schoone <6106846+jschoone@users.noreply.github.com> * Update .zuul.yaml Signed-off-by: Jan Schoone <6106846+jschoone@users.noreply.github.com> * Rename machineDeployment to 'default-worker' Signed-off-by: Roman Hros --------- Signed-off-by: michal.gubricky Signed-off-by: Jan Schoone <6106846+jschoone@users.noreply.github.com> Signed-off-by: Roman Hros Co-authored-by: Jan Schoone <6106846+jschoone@users.noreply.github.com> Co-authored-by: Roman Hros --- .zuul.yaml | 4 +-- playbooks/openstack/e2e.yaml | 33 +++++++++++++------ playbooks/openstack/templates/cluster.yaml.j2 | 2 +- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 91be9129..6b5140c8 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -25,7 +25,7 @@ parent: openstack-e2e-abstract description: | Run e2e tests of cluster-stacks project using - [sonobuoy](https://sonobuoy.io/) with mode conformance and + [sonobuoy](https://sonobuoy.io/) with mode non-disruptive conformance and SCS compliance checks meaning it will test if the Kubernetes cluster is conformant to the CNCF and to the SCS. timeout: 10800 # 3h @@ -33,7 +33,7 @@ wait_for_cluster: 1200 # 20min sonobouy: enabled: true - mode: conformance + mode: certified-conformance scs_compliance: enabled: true diff --git a/playbooks/openstack/e2e.yaml b/playbooks/openstack/e2e.yaml index ffad3881..4a3fc3d2 100644 --- a/playbooks/openstack/e2e.yaml +++ b/playbooks/openstack/e2e.yaml @@ -2,9 +2,7 @@ - name: Cluster stack OpenStack E2E test hosts: all vars: - cluster_stack: "providers/openstack/alpha/1-29" - cluster_stack_name: "openstack-alpha-1-29" - cluster_stack_version_name: alpha + cluster_stack_path: "providers/openstack/scs" project_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" cluster_stack_release_dir: "{{ ansible_user_dir }}/.release" cluster_manifest_dir: "{{ ansible_user_dir }}/cluster_manifest" @@ -39,19 +37,18 @@ ansible.builtin.set_fact: zuul_config: "{{ zuul_config | first | split('/n') | map('trim') | join('\n') }}" when: zuul_config is defined and zuul_config is not none and zuul_config != '' - - name: Extract cluster stack from Zuul config + - name: Extract cluster_stack_folder from Zuul config ansible.builtin.set_fact: - cluster_stack_name: "{{ zuul_config | regex_search('cluster_stack\\s*=\\s*\"([^\"]+)\"', '\\1') | first }}" + cluster_stack_folder: "{{ zuul_config | regex_search('cluster_stack_folder\\s*=\\s*\"([^\"]+)\"', '\\1') | first }}" when: - zuul_config is defined and zuul_config is not none and zuul_config != '' - zuul_config | regex_search('cluster_stack\\s*=\\s*\"([^\"]+)\"') is defined - - name: Override cluster stack if extracted + - name: Override cluster_stack_path if the cluster_stack_folder extracted ansible.builtin.set_fact: - cluster_stack: "{{ cluster_stack_name | regex_replace('^openstack-([a-zA-Z0-9]+)-([0-9]+-[0-9]+)$', 'providers/openstack/\\1/\\2') }}" - cluster_stack_version_name: "{{ cluster_stack_name | regex_replace('^openstack-([a-zA-Z0-9]+)-([0-9]+-[0-9]+)$', '\\1') }}" - when: cluster_stack_name is defined + cluster_stack_path: "providers/openstack/{{ cluster_stack_folder }}" + when: cluster_stack_folder is defined - name: Create cluster stack - ansible.builtin.command: "csctl create {{ project_dir }}/{{ cluster_stack }} --output {{ cluster_stack_release_dir }} --mode hash" + ansible.builtin.command: "csctl create {{ project_dir }}/{{ cluster_stack_path }} --output {{ cluster_stack_release_dir }} --mode hash" args: chdir: "{{ project_dir }}" changed_when: true @@ -126,6 +123,22 @@ ansible.builtin.set_fact: k8s_version_major_minor: "{{ k8s_version | regex_replace('^v?([0-9]+\\.[0-9]+)\\..*', '\\1') }}" when: k8s_version is defined + - name: Read the csctl.yaml file + ansible.builtin.slurp: + src: "{{ project_dir }}/{{ cluster_stack_path }}/csctl.yaml" + register: csctl_file_content + - name: Parse the csctl.yaml content + ansible.builtin.set_fact: + csctl_data: "{{ csctl_file_content.content | b64decode | from_yaml }}" + - name: Register cluster_stack_version_name + ansible.builtin.set_fact: + cluster_stack_version_name: "{{ csctl_data.config.clusterStackName }}" + - name: Format the kubernetesVersion for cluster_stack_name + ansible.builtin.set_fact: + k8s_version_formatted: "{{ k8s_version_major_minor | regex_replace('\\.', '-') }}" + - name: Create the cluster_stack_name + ansible.builtin.set_fact: + cluster_stack_name: "{{ csctl_data.config.provider.type }}-{{ csctl_data.config.clusterStackName }}-{{ k8s_version_formatted }}" - name: Extract cloud name from clouds_yaml_full ansible.builtin.set_fact: cloud_name: "{{ clouds_yaml_full.clouds.keys() | first }}" diff --git a/playbooks/openstack/templates/cluster.yaml.j2 b/playbooks/openstack/templates/cluster.yaml.j2 index e27ffbfa..9510da7f 100644 --- a/playbooks/openstack/templates/cluster.yaml.j2 +++ b/playbooks/openstack/templates/cluster.yaml.j2 @@ -35,7 +35,7 @@ spec: version: {{ k8s_version }} workers: machineDeployments: - - class: {{ cluster_stack_name }}-{{ cluster_stack_version }} + - class: default-worker failureDomain: nova name: {{ cluster_stack_name }} replicas: 3