Skip to content

Commit fcd5c9a

Browse files
committed
SREP-4417: Add AVO operator e2e as Prow presubmit and postsubmit
Create reusable step registry components for operator e2e testing: - rosa-operator-install: installs operator via PKO ClusterPackage - rosa-operator-e2e: runs Ginkgo e2e binary (ephemeral or persistent cluster) - rosa-operator-e2e-workflow: provisions ROSA Classic STS, installs operator via PKO, runs tests, deprovisions Add AVO as the first consumer with: - Presubmit: runs on PRs that change operator/test code - Postsubmit: runs on every merge, GitHub commit status gates SAPM promotion to stage/production No osde2e dependency -- runs the Ginkgo binary directly. Jira: SREP-4417
1 parent 049eeb2 commit fcd5c9a

16 files changed

Lines changed: 473 additions & 1 deletion

ci-operator/config/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ build_root:
33
images:
44
items:
55
- dockerfile_path: build/Dockerfile
6-
to: unused
6+
to: aws-vpce-operator
7+
- dockerfile_path: test/e2e/Containerfile.prow
8+
to: operator-e2e
79
resources:
810
'*':
911
limits:
@@ -53,6 +55,28 @@ tests:
5355
container:
5456
from: src
5557
skip_if_only_changed: ^(?:\.tekton|\.github)|\.md$|^(?:\.gitignore|OWNERS|LICENSE)$
58+
- as: avo-e2e-presubmit
59+
run_if_changed: ^(test/e2e/.*|pkg/.*|api/.*|cmd/.*|deploy/.*|go\.mod|go\.sum)$
60+
steps:
61+
cluster_profile: rosa-e2e-01
62+
env:
63+
CHANNEL_GROUP: stable
64+
OCM_LOGIN_ENV: staging
65+
OPERATOR_IMAGE: quay.io/redhat-services-prod/openshift/aws-vpce-operator:latest
66+
OPERATOR_NAME: aws-vpce-operator
67+
OPERATOR_PKO_IMAGE: quay.io/redhat-services-prod/openshift/aws-vpce-operator-pko:latest
68+
workflow: rosa-operator-e2e-workflow
69+
- as: avo-e2e-postsubmit
70+
postsubmit: true
71+
steps:
72+
cluster_profile: rosa-e2e-01
73+
env:
74+
CHANNEL_GROUP: stable
75+
OCM_LOGIN_ENV: staging
76+
OPERATOR_IMAGE: quay.io/redhat-services-prod/openshift/aws-vpce-operator:latest
77+
OPERATOR_NAME: aws-vpce-operator
78+
OPERATOR_PKO_IMAGE: quay.io/redhat-services-prod/openshift/aws-vpce-operator-pko:latest
79+
workflow: rosa-operator-e2e-workflow
5680
zz_generated_metadata:
5781
branch: main
5882
org: openshift

ci-operator/jobs/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main-postsubmits.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
postsubmits:
22
openshift/aws-vpce-operator:
3+
- agent: kubernetes
4+
always_run: true
5+
branches:
6+
- ^main$
7+
cluster: build03
8+
decorate: true
9+
labels:
10+
ci-operator.openshift.io/cloud: aws
11+
ci-operator.openshift.io/cloud-cluster-profile: rosa-e2e-01
12+
ci.openshift.io/generator: prowgen
13+
max_concurrency: 1
14+
name: branch-ci-openshift-aws-vpce-operator-main-avo-e2e-postsubmit
15+
spec:
16+
containers:
17+
- args:
18+
- --gcs-upload-secret=/secrets/gcs/service-account.json
19+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
20+
- --lease-server-credentials-file=/etc/boskos/credentials
21+
- --report-credentials-file=/etc/report/credentials
22+
- --target=avo-e2e-postsubmit
23+
command:
24+
- ci-operator
25+
env:
26+
- name: HTTP_SERVER_IP
27+
valueFrom:
28+
fieldRef:
29+
fieldPath: status.podIP
30+
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
31+
imagePullPolicy: Always
32+
name: ""
33+
ports:
34+
- containerPort: 8080
35+
name: http
36+
resources:
37+
requests:
38+
cpu: 10m
39+
volumeMounts:
40+
- mountPath: /etc/boskos
41+
name: boskos
42+
readOnly: true
43+
- mountPath: /secrets/gcs
44+
name: gcs-credentials
45+
readOnly: true
46+
- mountPath: /secrets/manifest-tool
47+
name: manifest-tool-local-pusher
48+
readOnly: true
49+
- mountPath: /etc/pull-secret
50+
name: pull-secret
51+
readOnly: true
52+
- mountPath: /etc/report
53+
name: result-aggregator
54+
readOnly: true
55+
serviceAccountName: ci-operator
56+
volumes:
57+
- name: boskos
58+
secret:
59+
items:
60+
- key: credentials
61+
path: credentials
62+
secretName: boskos-credentials
63+
- name: manifest-tool-local-pusher
64+
secret:
65+
secretName: manifest-tool-local-pusher
66+
- name: pull-secret
67+
secret:
68+
secretName: registry-pull-credentials
69+
- name: result-aggregator
70+
secret:
71+
secretName: result-aggregator
372
- agent: kubernetes
473
always_run: true
574
branches:

ci-operator/jobs/openshift/aws-vpce-operator/openshift-aws-vpce-operator-main-presubmits.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,79 @@
11
presubmits:
22
openshift/aws-vpce-operator:
3+
- agent: kubernetes
4+
always_run: false
5+
branches:
6+
- ^main$
7+
- ^main-
8+
cluster: build01
9+
context: ci/prow/avo-e2e-presubmit
10+
decorate: true
11+
labels:
12+
ci-operator.openshift.io/cloud: aws
13+
ci-operator.openshift.io/cloud-cluster-profile: rosa-e2e-01
14+
ci.openshift.io/generator: prowgen
15+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
16+
name: pull-ci-openshift-aws-vpce-operator-main-avo-e2e-presubmit
17+
rerun_command: /test avo-e2e-presubmit
18+
run_if_changed: ^(test/e2e/.*|pkg/.*|api/.*|cmd/.*|deploy/.*|go\.mod|go\.sum)$
19+
spec:
20+
containers:
21+
- args:
22+
- --gcs-upload-secret=/secrets/gcs/service-account.json
23+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
24+
- --lease-server-credentials-file=/etc/boskos/credentials
25+
- --report-credentials-file=/etc/report/credentials
26+
- --target=avo-e2e-presubmit
27+
command:
28+
- ci-operator
29+
env:
30+
- name: HTTP_SERVER_IP
31+
valueFrom:
32+
fieldRef:
33+
fieldPath: status.podIP
34+
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
35+
imagePullPolicy: Always
36+
name: ""
37+
ports:
38+
- containerPort: 8080
39+
name: http
40+
resources:
41+
requests:
42+
cpu: 10m
43+
volumeMounts:
44+
- mountPath: /etc/boskos
45+
name: boskos
46+
readOnly: true
47+
- mountPath: /secrets/gcs
48+
name: gcs-credentials
49+
readOnly: true
50+
- mountPath: /secrets/manifest-tool
51+
name: manifest-tool-local-pusher
52+
readOnly: true
53+
- mountPath: /etc/pull-secret
54+
name: pull-secret
55+
readOnly: true
56+
- mountPath: /etc/report
57+
name: result-aggregator
58+
readOnly: true
59+
serviceAccountName: ci-operator
60+
volumes:
61+
- name: boskos
62+
secret:
63+
items:
64+
- key: credentials
65+
path: credentials
66+
secretName: boskos-credentials
67+
- name: manifest-tool-local-pusher
68+
secret:
69+
secretName: manifest-tool-local-pusher
70+
- name: pull-secret
71+
secret:
72+
secretName: registry-pull-credentials
73+
- name: result-aggregator
74+
secret:
75+
secretName: result-aggregator
76+
trigger: (?m)^/test( | .* )avo-e2e-presubmit,?($|\s.*)
377
- agent: kubernetes
478
always_run: false
579
branches:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
approvers:
2+
- tiwillia
3+
- dustman9000
4+
- bmeng
5+
- ravitri
6+
reviewers:
7+
- tiwillia
8+
- dustman9000
9+
- bmeng
10+
- ravitri
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
approvers:
2+
- tiwillia
3+
- dustman9000
4+
- bmeng
5+
- ravitri
6+
reviewers:
7+
- tiwillia
8+
- dustman9000
9+
- bmeng
10+
- ravitri
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"path": "rosa/operator/e2e-workflow/rosa-operator-e2e-workflow-workflow.yaml",
3+
"owners": {
4+
"approvers": [
5+
"tiwillia",
6+
"dustman9000",
7+
"bmeng",
8+
"ravitri"
9+
],
10+
"reviewers": [
11+
"tiwillia",
12+
"dustman9000",
13+
"bmeng",
14+
"ravitri"
15+
]
16+
}
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
workflow:
2+
as: rosa-operator-e2e-workflow
3+
steps:
4+
env:
5+
CHANNEL_GROUP: stable
6+
OPENSHIFT_VERSION: ""
7+
pre:
8+
- chain: rosa-aws-sts-provision
9+
- ref: rosa-cluster-wait-ready-nodes
10+
- ref: rosa-operator-install
11+
test:
12+
- ref: rosa-operator-e2e
13+
post:
14+
- ref: osd-gather-extra
15+
- chain: rosa-aws-sts-deprovision
16+
documentation: |-
17+
Provisions a ROSA Classic STS cluster, installs an operator via PKO,
18+
runs the operator e2e tests, then deprovisions. Designed for operator
19+
CI validation with ephemeral clusters.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
approvers:
2+
- tiwillia
3+
- dustman9000
4+
- bmeng
5+
- ravitri
6+
reviewers:
7+
- tiwillia
8+
- dustman9000
9+
- bmeng
10+
- ravitri
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
set -o nounset
4+
set -o errexit
5+
set -o pipefail
6+
7+
trap 'CHILDREN=$(jobs -p); if test -n "${CHILDREN}"; then kill ${CHILDREN} && wait; fi' TERM
8+
9+
log(){
10+
echo -e "\033[1m$(date "+%d-%m-%YT%H:%M:%S") " "${*}\033[0m" >&2
11+
}
12+
13+
if [[ -z "${OPERATOR_NAME:-}" ]]; then
14+
log "ERROR: OPERATOR_NAME is required"
15+
exit 1
16+
fi
17+
18+
# Get cluster access: prefer shared kubeconfig from provision step,
19+
# fall back to backplane for persistent clusters
20+
if [[ -f "${SHARED_DIR}/kubeconfig" ]]; then
21+
log "Using kubeconfig from provision step"
22+
export KUBECONFIG="${SHARED_DIR}/kubeconfig"
23+
elif [[ -n "${OPERATOR_E2E_CLUSTER_ID:-}" ]]; then
24+
# Log into OCM for backplane access
25+
SSO_CLIENT_ID=$(cat "${CLUSTER_PROFILE_DIR}/sso-client-id" 2>/dev/null || true)
26+
SSO_CLIENT_SECRET=$(cat "${CLUSTER_PROFILE_DIR}/sso-client-secret" 2>/dev/null || true)
27+
OCM_TOKEN=$(cat "${CLUSTER_PROFILE_DIR}/ocm-token" 2>/dev/null || true)
28+
29+
if [[ -n "${SSO_CLIENT_ID}" && -n "${SSO_CLIENT_SECRET}" ]]; then
30+
log "Logging into ${OCM_LOGIN_ENV} with SSO credentials"
31+
ocm login --url "${OCM_LOGIN_ENV}" --client-id "${SSO_CLIENT_ID}" --client-secret "${SSO_CLIENT_SECRET}"
32+
elif [[ -n "${OCM_TOKEN}" ]]; then
33+
log "Logging into ${OCM_LOGIN_ENV} with offline token"
34+
ocm login --url "${OCM_LOGIN_ENV}" --token "${OCM_TOKEN}"
35+
else
36+
log "ERROR: No OCM credentials found in cluster profile"
37+
exit 1
38+
fi
39+
40+
log "Getting kubeconfig for cluster ${OPERATOR_E2E_CLUSTER_ID} via backplane"
41+
ocm backplane login "${OPERATOR_E2E_CLUSTER_ID}"
42+
else
43+
log "ERROR: No cluster access method available (no SHARED_DIR/kubeconfig or OPERATOR_E2E_CLUSTER_ID)"
44+
exit 1
45+
fi
46+
47+
# Verify cluster access
48+
oc whoami
49+
log "Connected to cluster: $(oc whoami --show-server)"
50+
51+
# Run the operator e2e tests
52+
JUNIT_REPORT="${ARTIFACT_DIR}/junit-${OPERATOR_NAME}-e2e.xml"
53+
GINKGO_FLAGS="--ginkgo.junit-report=${JUNIT_REPORT} --ginkgo.v"
54+
55+
if [[ -n "${GINKGO_LABEL_FILTER:-}" ]]; then
56+
GINKGO_FLAGS="${GINKGO_FLAGS} --ginkgo.label-filter=${GINKGO_LABEL_FILTER}"
57+
fi
58+
59+
log "Running ${OPERATOR_NAME} e2e tests..."
60+
/usr/local/bin/e2e.test ${GINKGO_FLAGS} || {
61+
log "Tests failed. JUnit report at ${JUNIT_REPORT}"
62+
exit 1
63+
}
64+
65+
log "Tests passed. JUnit report at ${JUNIT_REPORT}"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"path": "rosa/operator/e2e/rosa-operator-e2e-ref.yaml",
3+
"owners": {
4+
"approvers": [
5+
"tiwillia",
6+
"dustman9000",
7+
"bmeng",
8+
"ravitri"
9+
],
10+
"reviewers": [
11+
"tiwillia",
12+
"dustman9000",
13+
"bmeng",
14+
"ravitri"
15+
]
16+
}
17+
}

0 commit comments

Comments
 (0)