From 682f5d3d2a92f46f3affbf215e01d0947d2ec44e Mon Sep 17 00:00:00 2001 From: Brendan Shephard Date: Tue, 13 Aug 2024 13:06:53 +1000 Subject: [PATCH] Allow for Jobs instead of AnsibleEE CR in kuttl Signed-off-by: Brendan Shephard --- ...tackdataplanedeployment_controller_test.go | 6 ++--- .../01-assert.yaml | 4 ++-- .../02-assert.yaml | 8 +------ .../02-assert.yaml | 6 ++--- .../dataplane-service-failure/00-assert.yaml | 22 ++++++++----------- 5 files changed, 18 insertions(+), 28 deletions(-) diff --git a/tests/functional/dataplane/openstackdataplanedeployment_controller_test.go b/tests/functional/dataplane/openstackdataplanedeployment_controller_test.go index bfec131e2..499c8ba97 100644 --- a/tests/functional/dataplane/openstackdataplanedeployment_controller_test.go +++ b/tests/functional/dataplane/openstackdataplanedeployment_controller_test.go @@ -1217,7 +1217,7 @@ var _ = Describe("Dataplane Deployment Test", func() { Namespace: dataplaneMultiNodesetDeploymentName.Namespace, } ansibleEE := GetAnsibleee(ansibleeeName) - ansibleEE.Status.JobStatus = ansibleeev1.JobStatusSucceeded + ansibleEE.Status.Succeeded = 1 g.Expect(th.K8sClient.Status().Update(th.Ctx, ansibleEE)).To(Succeed()) }, th.Timeout, th.Interval).Should(Succeed()) } @@ -1424,7 +1424,7 @@ var _ = Describe("Dataplane Deployment Test", func() { Namespace: dataplaneMultiNodesetDeploymentName.Namespace, } ansibleEE := GetAnsibleee(ansibleeeName) - ansibleEE.Status.JobStatus = ansibleeev1.JobStatusSucceeded + ansibleEE.Status.Succeeded = 1 g.Expect(th.K8sClient.Status().Update(th.Ctx, ansibleEE)).To(Succeed()) }, th.Timeout, th.Interval).Should(Succeed()) } @@ -1449,7 +1449,7 @@ var _ = Describe("Dataplane Deployment Test", func() { Namespace: dataplaneMultiNodesetDeploymentName.Namespace, } ansibleEE := GetAnsibleee(ansibleeeName) - ansibleEE.Status.JobStatus = ansibleeev1.JobStatusSucceeded + ansibleEE.Status.Succeeded = 1 g.Expect(th.K8sClient.Status().Update(th.Ctx, ansibleEE)).To(Succeed()) }, th.Timeout, th.Interval).Should(Succeed()) } diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml index 584d5018d..7714ebbf3 100644 --- a/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml @@ -149,7 +149,7 @@ spec: volumeMounts: - mountPath: /runner/env/ssh_key/ssh_key_edpm-compute-global name: ssh-key-edpm-compute-global - subPath: ssh_key_edpm-compute-global + subPath: ssh_key_edpm-compute-global - mountPath: /runner/inventory/inventory-0 name: inventory-0 subPath: inventory-0 @@ -157,7 +157,7 @@ spec: schedulerName: default-scheduler securityContext: {} serviceAccount: edpm-compute-global - serviceAccountName: edpm-compute-global + serviceAccountName: edpm-compute-global terminationGracePeriodSeconds: 30 volumes: - name: ssh-key-edpm-compute-global diff --git a/tests/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml b/tests/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml index 444501871..ff6eae8dd 100644 --- a/tests/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml +++ b/tests/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml @@ -70,7 +70,7 @@ metadata: namespace: openstack-kuttl-tests spec: nodeSets: - - edpm-compute-global + - edpm-multinodeset - edpm-compute-beta-nodeset --- apiVersion: batch/v1 @@ -102,8 +102,6 @@ spec: suspend: false template: metadata: - annotations: - k8s.v1.cni.cncf.io/networks: '[]' creationTimestamp: null labels: app: openstackansibleee @@ -151,7 +149,6 @@ spec: - mountPath: /runner/inventory/hosts name: inventory subPath: inventory - dnsPolicy: ClusterFirst restartPolicy: OnFailure schedulerName: default-scheduler securityContext: {} @@ -211,8 +208,6 @@ spec: suspend: false template: metadata: - annotations: - k8s.v1.cni.cncf.io/networks: '[]' creationTimestamp: null labels: app: openstackansibleee @@ -260,7 +255,6 @@ spec: - mountPath: /runner/inventory/hosts name: inventory subPath: inventory - dnsPolicy: ClusterFirst restartPolicy: OnFailure schedulerName: default-scheduler securityContext: {} diff --git a/tests/kuttl/tests/dataplane-deploy-multiple-secrets/02-assert.yaml b/tests/kuttl/tests/dataplane-deploy-multiple-secrets/02-assert.yaml index 520085517..2a8a8dd3a 100644 --- a/tests/kuttl/tests/dataplane-deploy-multiple-secrets/02-assert.yaml +++ b/tests/kuttl/tests/dataplane-deploy-multiple-secrets/02-assert.yaml @@ -189,7 +189,7 @@ spec: schedulerName: default-scheduler securityContext: {} serviceAccount: openstack-edpm-tls - serviceAccountName: openstack-edpm-tls + serviceAccountName: openstack-edpm-tls terminationGracePeriodSeconds: 30 volumes: - name: ssh-key-openstack-edpm-tls @@ -293,7 +293,7 @@ spec: volumeMounts: - mountPath: /runner/env/ssh_key/ssh_key_openstack-edpm-tls name: ssh-key-openstack-edpm-tls - subPath: ssh_key_openstack-edpm-tls + subPath: ssh_key_openstack-edpm-tls - mountPath: /runner/inventory/inventory name: inventory subPath: inventory @@ -301,7 +301,7 @@ spec: schedulerName: default-scheduler securityContext: {} serviceAccount: openstack-edpm-tls - serviceAccountName: openstack-edpm-tls + serviceAccountName: openstack-edpm-tls terminationGracePeriodSeconds: 30 volumes: - name: ssh-key-openstack-edpm-tls diff --git a/tests/kuttl/tests/dataplane-service-failure/00-assert.yaml b/tests/kuttl/tests/dataplane-service-failure/00-assert.yaml index bebaf7643..a07dc6272 100644 --- a/tests/kuttl/tests/dataplane-service-failure/00-assert.yaml +++ b/tests/kuttl/tests/dataplane-service-failure/00-assert.yaml @@ -80,7 +80,6 @@ spec: edpm_service_type: failed-service - image: quay.io/openstack-k8s-operators/openstack-ansibleee-runner:latest imagePullPolicy: Always name: failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes resources: {} @@ -116,10 +115,7 @@ spec: path: inventory secretName: dataplanenodeset-edpm-compute-no-nodes status: - active: 1 - ready: 0 - terminating: 0 - uncountedTerminatedPods: {} + failed: 1 --- apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet @@ -140,14 +136,14 @@ status: conditions: - message: 'Deployment error occurred in failed-service service error backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: Error severity: Error status: "False" type: Ready - message: 'Deployment error occurred in failed-service service error backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: Error severity: Error status: "False" @@ -176,14 +172,14 @@ status: edpm-compute-no-nodes: - message: 'Deployment error occurred in failed-service service error backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: BackoffLimitExceeded severity: Error status: "False" type: NodeSetDeploymentReady - message: 'Deployment error occurred in failed-service service error backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: BackoffLimitExceeded severity: Error status: "False" @@ -205,14 +201,14 @@ status: conditions: - message: 'Deployment error occurred nodeSet: edpm-compute-no-nodes error: backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: BackoffLimitExceeded severity: Error status: "False" type: Ready - message: 'Deployment error occurred nodeSet: edpm-compute-no-nodes error: backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: BackoffLimitExceeded severity: Error status: "False" @@ -225,14 +221,14 @@ status: edpm-compute-no-nodes: - message: 'Deployment error occurred in failed-service service error backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: BackoffLimitExceeded severity: Error status: "False" type: NodeSetDeploymentReady - message: 'Deployment error occurred in failed-service service error backoff limit reached for execution.name failed-service-edpm-compute-no-nodes-edpm-compute-no-nodes - execution.namespace openstack-kuttl-tests execution.status.jobstatus: Failed' + execution.namespace openstack-kuttl-tests execution.condition.message: Job has reached the specified backoff limit' reason: BackoffLimitExceeded severity: Error status: "False"