From a48e92d2df57d863fbbaeccc6d99bd4163c0d0ca Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Thu, 16 May 2024 11:06:21 +0200 Subject: [PATCH] [test-operator] Expose nodeSelector and tolerations parameters This patch exposes nodeSelector and tolerations parameters in the test-operator role. These two parameters were introduced to test-operator in the linked PR. Depends-On: https://github.com/openstack-k8s-operators/test-operator/pull/95 --- roles/test_operator/README.md | 6 ++++++ roles/test_operator/defaults/main.yml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/roles/test_operator/README.md b/roles/test_operator/README.md index 2d27c6037b..84456a0e51 100644 --- a/roles/test_operator/README.md +++ b/roles/test_operator/README.md @@ -16,6 +16,8 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/ * `cifmw_test_operator_dry_run`: (Boolean) Whether test-operator should run or not. Default value: `false` * `cifmw_test_operator_fail_fast`: (Boolean) Whether the test results are evaluated when each test framework execution finishes or when all test frameworks are done. Default value: `false` * `cifmw_test_operator_controller_ip`: (String) An ip address of the controller node. Default value: `ansible_default_ipv4.address` which defaults to (`""`). +* `cifmw_test_operator_tolerations`: (Dict) `tolerations` value that is applied to all pods spawned by the test-operator. Default value: `{}` +* `cifmw_test_operator_node_selector`: (Dict) `nodeSelector` value that is applied to all pods spawned by the test-operator. Default value: `{}` ## Tempest specific parameters * `cifmw_test_operator_tempest_registry`: (String) The registry where to pull tempest container. Default value: `quay.io` @@ -42,6 +44,8 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/ namespace: "{{ cifmw_test_operator_namespace }}" spec: containerImage: "{{ cifmw_test_operator_tempest_image }}:{{ cifmw_test_operator_tempest_image_tag }}" + tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}" + nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}" tempestRun: includeList: | {{ cifmw_test_operator_tempest_include_list | default('') }} @@ -81,6 +85,8 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/ testenv: "{{ cifmw_test_operator_tobiko_testenv }}" version: "{{ cifmw_test_operator_tobiko_version }}" pytestAddopts: "{{ cifmw_test_operator_tobiko_pytest_addopts if cifmw_test_operator_tobiko_pytest_addopts is not none else omit }}" + tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}" + nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}" # preventCreate: preventCreate is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_prevent_create # numProcesses: numProcesses is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_num_processes # privateKey: privateKey is automatically generated by the test_operator role diff --git a/roles/test_operator/defaults/main.yml b/roles/test_operator/defaults/main.yml index 4a72f05f0c..269a1dbb12 100644 --- a/roles/test_operator/defaults/main.yml +++ b/roles/test_operator/defaults/main.yml @@ -64,6 +64,8 @@ cifmw_test_operator_tempest_config: externalPlugin: "{{ cifmw_test_operator_tempest_external_plugin | default([]) }}" neutronExtraImage: "{{ cifmw_test_operator_tempest_ntp_extra_image | default('') }}" tempestconfRun: "{{ cifmw_tempest_tempestconf_config | default(omit) }}" + tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}" + nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}" workflow: "{{ cifmw_test_operator_tempest_workflow }}" # Section 3: tobiko parameters - used when run_test_fw is 'tobiko' @@ -94,6 +96,8 @@ cifmw_test_operator_tobiko_config: testenv: "{{ cifmw_test_operator_tobiko_testenv }}" version: "{{ cifmw_test_operator_tobiko_version }}" pytestAddopts: "{{ cifmw_test_operator_tobiko_pytest_addopts if cifmw_test_operator_tobiko_pytest_addopts is not none else omit }}" + tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}" + nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}" # preventCreate: preventCreate is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_prevent_create # numProcesses: numProcesses is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_num_processes # privateKey: privateKey is automatically by the test_operator role