Skip to content

Commit

Permalink
Allow for Jobs instead of AnsibleEE CR in kuttl
Browse files Browse the repository at this point in the history
Signed-off-by: Brendan Shephard <[email protected]>
  • Loading branch information
bshephar committed Aug 29, 2024
1 parent 71dcfa8 commit 1766b3a
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down Expand Up @@ -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())
}
Expand All @@ -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())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ 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
restartPolicy: OnFailure
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ spec:
suspend: false
template:
metadata:
annotations:
k8s.v1.cni.cncf.io/networks: '[]'
creationTimestamp: null
labels:
app: openstackansibleee
Expand Down Expand Up @@ -151,7 +149,6 @@ spec:
- mountPath: /runner/inventory/hosts
name: inventory
subPath: inventory
dnsPolicy: ClusterFirst
restartPolicy: OnFailure
schedulerName: default-scheduler
securityContext: {}
Expand Down Expand Up @@ -211,8 +208,6 @@ spec:
suspend: false
template:
metadata:
annotations:
k8s.v1.cni.cncf.io/networks: '[]'
creationTimestamp: null
labels:
app: openstackansibleee
Expand Down Expand Up @@ -260,7 +255,6 @@ spec:
- mountPath: /runner/inventory/hosts
name: inventory
subPath: inventory
dnsPolicy: ClusterFirst
restartPolicy: OnFailure
schedulerName: default-scheduler
securityContext: {}
Expand Down
68 changes: 42 additions & 26 deletions tests/kuttl/tests/dataplane-deploy-multiple-secrets/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ spec:
- name: RUNNER_EXTRA_VARS
value: |2+
edpm_override_hosts: all
edpm_service_type: custom-global-service
edpm_override_hosts: openstack-edpm-tls
edpm_service_type: install-certs-ovr
imagePullPolicy: Always
Expand All @@ -179,27 +179,45 @@ spec:
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /runner/env/ssh_key/ssh_key_openstack-edpm-tls
name: ssh-key-openstack-edpm-tls
subPath: ssh_key_openstack-edpm-tls
- mountPath: /runner/inventory/inventory
- mountPath: /var/lib/openstack/certs/generic-service1/default
name: openstack-edpm-tls-generic-service1-default-certs-0
- mountPath: /var/lib/openstack/cacerts/generic-service1
name: generic-service1-combined-ca-bundle
- mountPath: /runner/env/ssh_key
name: ssh-key
subPath: ssh_key
- mountPath: /runner/inventory/hosts
name: inventory
subPath: inventory
restartPolicy: OnFailure
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
- name: openstack-edpm-tls-generic-service1-default-certs-0
projected:
defaultMode: 420
sources:
- secret:
name: openstack-edpm-tls-generic-service1-default-certs-0
- secret:
name: openstack-edpm-tls-generic-service1-default-certs-1
- secret:
name: openstack-edpm-tls-generic-service1-default-certs-2
- name: generic-service1-combined-ca-bundle
secret:
defaultMode: 420
secretName: combined-ca-bundle
- name: ssh-key
secret:
defaultMode: 420
items:
- key: ssh-privatekey
path: ssh_key_openstack-edpm-tls
path: ssh_key
secretName: dataplane-ansible-ssh-private-key-secret
- name: inventory-0
- name: inventory
secret:
defaultMode: 420
items:
Expand All @@ -219,12 +237,11 @@ metadata:
generation: 1
labels:
app: openstackansibleee
batch.kubernetes.io/job-name: generic-service1-openstack-edpm-tls-openstack-edpm-tls
job-name: generic-service1-openstack-edpm-tls-openstack-edpm-tls
openstackansibleee_cr: generic-service1-openstack-edpm-tls-openstack-edpm-tls
openstackdataplanedeployment: openstack-edpm-tls
openstackdataplanenodeset: openstack-edpm-tls
openstackdataplaneservice: generic-service1-openstack-edpm-tls
openstackdataplaneservice: generic-service1
osaee: "true"
name: generic-service1-openstack-edpm-tls-openstack-edpm-tls
namespace: openstack-kuttl-tests
Expand All @@ -246,12 +263,11 @@ spec:
metadata:
labels:
app: openstackansibleee
batch.kubernetes.io/job-name: generic-service1-openstack-edpm-tls-openstack-edpm-tls
job-name: generic-service1-openstack-edpm-tls-openstack-edpm-tls
openstackansibleee_cr: generic-service1-openstack-edpm-tls-openstack-edpm-tls
openstackdataplanedeployment: openstack-edpm-tls
openstackdataplanenodeset: openstack-edpm-tls
openstackdataplaneservice: generic-service1-openstack-edpm-tls
openstackdataplaneservice: generic-service1
osaee: "true"
spec:
containers:
Expand All @@ -271,7 +287,7 @@ spec:
- hosts: localhost
gather_facts: no
name: global kuttl play
name: kuttl play
tasks:
- name: Sleep
command: sleep 1
Expand All @@ -281,37 +297,37 @@ spec:
- name: RUNNER_EXTRA_VARS
value: |2+
edpm_override_hosts: all
edpm_service_type: custom-global-service
edpm_override_hosts: openstack-edpm-tls
edpm_service_type: generic-service1
imagePullPolicy: Always
name: custom-global-service-openstack-edpm-tls
name: generic-service1-openstack-edpm-tls-openstack-edpm-tls
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /runner/env/ssh_key/ssh_key_openstack-edpm-tls
name: ssh-key-openstack-edpm-tls
subPath: ssh_key_openstack-edpm-tls
- mountPath: /runner/inventory/inventory
- mountPath: /runner/env/ssh_key
name: ssh-key
subPath: ssh_key
- mountPath: /runner/inventory/hosts
name: inventory
subPath: inventory
restartPolicy: OnFailure
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
- name: ssh-key
secret:
defaultMode: 420
items:
- key: ssh-privatekey
path: ssh_key_openstack-edpm-tls
path: ssh_key
secretName: dataplane-ansible-ssh-private-key-secret
- name: inventory-0
- name: inventory
secret:
defaultMode: 420
items:
Expand Down
22 changes: 9 additions & 13 deletions tests/kuttl/tests/dataplane-service-failure/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 1766b3a

Please sign in to comment.