diff --git a/tests/kuttl/tests/ctlplane-nodeselectors/01-deploy-openstack.yaml b/tests/kuttl/tests/ctlplane-nodeselectors/01-deploy-openstack.yaml index bfffa10c8..ae7856cd3 100644 --- a/tests/kuttl/tests/ctlplane-nodeselectors/01-deploy-openstack.yaml +++ b/tests/kuttl/tests/ctlplane-nodeselectors/01-deploy-openstack.yaml @@ -1,5 +1,7 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: + - script: | + oc annotate namespace $NAMESPACE openshift.io/node-selector="beta.kubernetes.io/os=linux" - script: | oc kustomize ../../../../config/samples/nodeselectors/global | oc apply -n $NAMESPACE -f - diff --git a/tests/kuttl/tests/ctlplane-nodeselectors/02-assert-nodeselector.yaml b/tests/kuttl/tests/ctlplane-nodeselectors/02-assert-nodeselector.yaml index dfb3f117a..bf160a363 100644 --- a/tests/kuttl/tests/ctlplane-nodeselectors/02-assert-nodeselector.yaml +++ b/tests/kuttl/tests/ctlplane-nodeselectors/02-assert-nodeselector.yaml @@ -3,7 +3,7 @@ kind: TestAssert commands: - script: | echo "Checking all pods have expected nodeselector" - EXPECTED_NODE_SELECTOR="node-role.kubernetes.io/worker:" + EXPECTED_NODE_SELECTOR="beta.kubernetes.io/os:linux node-role.kubernetes.io/worker:" BAD_OR_MISSING_NODE_SELECTOR=$(oc get pods -n $NAMESPACE -l service!=dnsmasq -o=go-template --template='{{ range .items }}{{ .metadata.name}}: {{ .spec.nodeSelector }}{{"\n"}}{{ end }}' | grep -v 'ovn-controller-.*-config' | sed -e '\!map\['"$EXPECTED_NODE_SELECTOR"'\]$!d') BAD_OR_MISSING_NODE_SELECTOR_COUNT=$(echo -n "$BAD_OR_MISSING_NODE_SELECTOR" | wc -l) if [ $BAD_OR_MISSING_NODE_SELECTOR_COUNT -ne 0 ]; then diff --git a/tests/kuttl/tests/ctlplane-nodeselectors/03-update-nodeselector.yaml b/tests/kuttl/tests/ctlplane-nodeselectors/03-update-nodeselector.yaml index 2d50bda2e..9bd994514 100644 --- a/tests/kuttl/tests/ctlplane-nodeselectors/03-update-nodeselector.yaml +++ b/tests/kuttl/tests/ctlplane-nodeselectors/03-update-nodeselector.yaml @@ -2,12 +2,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep timeout: 60 commands: - - script: | - oc patch dnsmasq -n $NAMESPACE dnsmasq --type='json' -p='[{ - "op": "replace", - "path": "/spec/nodeSelector", - "value": {"kubernetes.io/os":"linux"} - }]' - script: | oc patch openstackcontrolplane -n $NAMESPACE openstack --type='json' -p='[{ "op": "replace", diff --git a/tests/kuttl/tests/ctlplane-nodeselectors/04-assert-nodeselector.yaml b/tests/kuttl/tests/ctlplane-nodeselectors/04-assert-nodeselector.yaml index 031ccccc3..3df8c4772 100644 --- a/tests/kuttl/tests/ctlplane-nodeselectors/04-assert-nodeselector.yaml +++ b/tests/kuttl/tests/ctlplane-nodeselectors/04-assert-nodeselector.yaml @@ -3,7 +3,7 @@ kind: TestAssert commands: - script: | echo "Checking all running pods have new nodeselector" - EXPECTED_NODE_SELECTOR="kubernetes.io/os:linux" + EXPECTED_NODE_SELECTOR="beta.kubernetes.io/os:linux kubernetes.io/os:linux" BAD_OR_MISSING_NODE_SELECTOR=$(oc get pods -n $NAMESPACE -l service!=dnsmasq --field-selector=status.phase=Running -o=go-template --template='{{ range .items }}{{ .metadata.name}}: {{ .spec.nodeSelector }}{{"\n"}}{{ end }}' | grep -v 'ovn-controller-.*-config' | sed -e '\!map\['"$EXPECTED_NODE_SELECTOR"'\]$!d') BAD_OR_MISSING_NODE_SELECTOR_COUNT=$(echo -n "$BAD_OR_MISSING_NODE_SELECTOR" | wc -l) if [ $BAD_OR_MISSING_NODE_SELECTOR_COUNT -ne 0 ]; then diff --git a/tests/kuttl/tests/ctlplane-nodeselectors/05-cleanup.yaml b/tests/kuttl/tests/ctlplane-nodeselectors/05-cleanup.yaml index 6b4992512..722a0e8b1 100644 --- a/tests/kuttl/tests/ctlplane-nodeselectors/05-cleanup.yaml +++ b/tests/kuttl/tests/ctlplane-nodeselectors/05-cleanup.yaml @@ -6,6 +6,7 @@ delete: name: openstack commands: - script: | + oc annotate namespace $NAMESPACE openshift.io/node-selector- oc delete --ignore-not-found=true -n $NAMESPACE pvc \ srv-swift-storage-0 oc delete secret --ignore-not-found=true combined-ca-bundle -n $NAMESPACE