-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: RHINENG-9589 add autopromotion pipeline tests
- Loading branch information
1 parent
8fad0a3
commit 43a99d0
Showing
16 changed files
with
285 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace: floorist-operator-system | ||
|
||
resources: | ||
- ./local | ||
|
||
images: | ||
- name: quay.io/cloudservices/floorist-operator | ||
newName: ${IMAGE} | ||
newTag: ${IMAGE_TAG} | ||
|
||
patches: | ||
- path: test_params.config.yaml | ||
target: | ||
group: batch | ||
kind: Job | ||
name: stage-test | ||
version: v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
# Adds namespace to all resources. | ||
namespace: default | ||
|
||
# Value of this field is prepended to the | ||
# names of all resources, e.g. a deployment named | ||
# "wordpress" becomes "alices-wordpress". | ||
# Note that it should also match with the prefix (text before '-') of the namespace | ||
# field above. | ||
namePrefix: floorist-operator- | ||
|
||
# Labels to add to all resources and selectors. | ||
#commonLabels: | ||
# someName: someValue | ||
|
||
resources: | ||
- stage_test_service_account.yaml | ||
- stage_test_role.yaml | ||
- stage_test_role_binding.yaml | ||
- stage_test.yaml | ||
|
||
images: | ||
- name: controller | ||
newName: quay.io/cloudservices/floorist-operator | ||
newTag: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: stage-test | ||
spec: | ||
backoffLimit: 2 | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
serviceAccountName: stage-test-service-account | ||
containers: | ||
- image: controller:latest | ||
name: floorist-operator-stage-test | ||
imagePullPolicy: Always | ||
command: | ||
- sh | ||
args: | ||
- stage_test.sh | ||
resources: | ||
requests: | ||
memory: 256Mi | ||
cpu: 200m | ||
limits: | ||
memory: 512Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: stage-test-role | ||
rules: | ||
- apiGroups: | ||
- batch | ||
resources: | ||
- cronjobs | ||
- jobs | ||
verbs: | ||
- get | ||
- list | ||
- watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: stage-test-rolebinding | ||
roleRef: | ||
kind: Role | ||
name: stage-test-role | ||
apiGroup: rbac.authorization.k8s.io | ||
subjects: | ||
- kind: ServiceAccount | ||
name: stage-test-service-account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: stage-test-service-account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- description: Operator image | ||
name: IMAGE | ||
value: quay.io/cloudservices/floorist-operator | ||
- description: Operator image tag | ||
name: IMAGE_TAG | ||
value: '' | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- op: replace | ||
path: /metadata/name | ||
value: floorist-operator-stage-test-${IMAGE_TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
CRONJOBS=$(oc get cronjobs | awk 'NR>1 {print $1}') | ||
|
||
if [[ -z "$CRONJOBS" ]]; then | ||
echo "ERROR: no cronjobs found" | ||
exit 1 | ||
fi | ||
|
||
for CRONJOB in $CRONJOBS; do | ||
SUCCESS=$(oc get job -l "pod=${CRONJOB}" -o jsonpath='{.items[].status.succeeded}{"\n"}') | ||
|
||
if [[ -z "$SUCCESS" ]]; then | ||
echo "ERROR: cronjob $CRONJOB has not created any jobs" | ||
exit 1 | ||
fi | ||
|
||
if [[ "$SUCCESS" != "1" ]]; then | ||
echo "ERROR: cronjob $CRONJOB has not created successful jobs" | ||
exit 1 | ||
fi | ||
done |
Oops, something went wrong.