diff --git a/ci-operator/config/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main.yaml b/ci-operator/config/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main.yaml index 39164640f5c2b..e4938f8175c96 100644 --- a/ci-operator/config/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main.yaml +++ b/ci-operator/config/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main.yaml @@ -1,9 +1,22 @@ +base_images: + operator-sdk: + name: "4.17" + namespace: origin + tag: operator-sdk build_root: from_repository: true images: items: - dockerfile_path: Dockerfile to: bgp-cloud-connector +operator: + bundles: + - as: bgp-cloud-connector-bundle + dockerfile_path: bundle.Dockerfile + skip_building_index: true + substitutions: + - pullspec: controller:latest + with: pipeline:bgp-cloud-connector releases: initial: integration: @@ -60,6 +73,96 @@ tests: cpu: 100m memory: 200Mi workflow: ipi-aws +- always_run: false + as: e2e-aws-operator + optional: true + steps: + cluster_profile: openshift-org-aws + env: + ZONES_COUNT: "2" + test: + - as: enable-frr + cli: latest + commands: | + set -euo pipefail + + # Both controllers watch FRRConfiguration and RouteAdvertisements + # from SetupWithManager, and CNO creates those two CRDs only in + # response to this patch. Without them the caches never sync, the + # manager exits after two minutes, and the CSV never installs. + # The operator applies this same patch itself as the first phase + # of reconcile, but it cannot stay alive long enough to do so; + # when that is fixed, this step comes out and the job proves the + # install a catalogue user actually performs. + oc patch network.operator.openshift.io cluster --type=merge \ + -p '{"spec":{"additionalRoutingCapabilities":{"providers":["FRR"]},"defaultNetwork":{"ovnKubernetesConfig":{"routeAdvertisements":"Enabled"}}}}' + + deadline=$((SECONDS + 900)) + + for crd in frrconfigurations.frrk8s.metallb.io routeadvertisements.k8s.ovn.org; do + echo "waiting for crd/${crd}..." + until oc wait --for=condition=Established "crd/${crd}" --timeout=10s >/dev/null 2>&1; do + if (( SECONDS >= deadline )); then + oc get network.operator.openshift.io cluster -o yaml >&2 + echo "timed out waiting for crd/${crd}" >&2 + exit 1 + fi + sleep 5 + done + done + + # The rollout is what says CNO finished rather than that it + # started. Measured at about two minutes on 4.22. + echo "waiting for the frr-k8s rollout..." + until oc -n openshift-frr-k8s rollout status daemonset/frr-k8s --timeout=2m >/dev/null 2>&1; do + if (( SECONDS >= deadline )); then + oc -n openshift-frr-k8s get pods >&2 + echo "timed out waiting for the frr-k8s daemonset" >&2 + exit 1 + fi + sleep 5 + done + + oc -n openshift-frr-k8s get daemonset frr-k8s + from: src + resources: + requests: + cpu: 100m + memory: 200Mi + - as: install + cli: latest + commands: | + set -euo pipefail + + oc create namespace openshift-cudn-bgp-routing --dry-run=client -o yaml | oc apply -f - + + # The CSV supports OwnNamespace and SingleNamespace only. The + # manager scopes no caches, so it watches cluster-wide either + # way. + operator-sdk run bundle -n openshift-cudn-bgp-routing --timeout=10m \ + --security-context-config restricted --install-mode OwnNamespace "${OO_BUNDLE}" + + oc -n openshift-cudn-bgp-routing wait --for=condition=Available \ + deployment/openshift-cudn-bgp-routing-controller-manager --timeout=5m + oc -n openshift-cudn-bgp-routing get csv + dependencies: + - env: OO_BUNDLE + name: bgp-cloud-connector-bundle + from: operator-sdk + resources: + requests: + cpu: 100m + memory: 200Mi + - as: test + cli: latest + commands: hack/ci-e2e-aws.sh + from: src + grace_period: 30m0s + resources: + requests: + cpu: 100m + memory: 200Mi + workflow: ipi-aws zz_generated_metadata: branch: main org: openshift diff --git a/ci-operator/jobs/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main-presubmits.yaml b/ci-operator/jobs/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main-presubmits.yaml index 6273a057c41a2..109c224c2a64f 100644 --- a/ci-operator/jobs/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main-presubmits.yaml +++ b/ci-operator/jobs/openshift/bgp-cloud-connector/openshift-bgp-cloud-connector-main-presubmits.yaml @@ -1,5 +1,62 @@ presubmits: openshift/bgp-cloud-connector: + - agent: kubernetes + always_run: true + branches: + - ^main$ + - ^main- + cluster: build10 + context: ci/prow/ci-bundle-bgp-cloud-connector-bundle + decorate: true + decoration_config: + sparse_checkout_files: + - .ci-operator.yaml + - Dockerfile + labels: + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-bgp-cloud-connector-main-ci-bundle-bgp-cloud-connector-bundle + rerun_command: /test ci-bundle-bgp-cloud-connector-bundle + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --report-credentials-file=/etc/report/credentials + - --target=bgp-cloud-connector-bundle + command: + - ci-operator + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )ci-bundle-bgp-cloud-connector-bundle,?($|\s.*) - agent: kubernetes always_run: false branches: @@ -85,6 +142,91 @@ presubmits: secret: secretName: result-aggregator trigger: (?m)^/test( | .* )e2e-aws,?($|\s.*) + - agent: kubernetes + always_run: false + branches: + - ^main$ + - ^main- + cluster: build09 + context: ci/prow/e2e-aws-operator + decorate: true + decoration_config: + sparse_checkout_files: + - .ci-operator.yaml + - Dockerfile + labels: + ci-operator.openshift.io/cloud: aws + ci-operator.openshift.io/cloud-cluster-profile: openshift-org-aws + ci.openshift.io/generator: prowgen + pj-rehearse.openshift.io/can-be-rehearsed: "true" + name: pull-ci-openshift-bgp-cloud-connector-main-e2e-aws-operator + optional: true + rerun_command: /test e2e-aws-operator + spec: + containers: + - args: + - --gcs-upload-secret=/secrets/gcs/service-account.json + - --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson + - --lease-server-credentials-file=/etc/boskos/credentials + - --report-credentials-file=/etc/report/credentials + - --secret-dir=/secrets/ci-pull-credentials + - --target=e2e-aws-operator + command: + - ci-operator + env: + - name: HTTP_SERVER_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest + imagePullPolicy: Always + name: "" + ports: + - containerPort: 8080 + name: http + resources: + requests: + cpu: 10m + volumeMounts: + - mountPath: /etc/boskos + name: boskos + readOnly: true + - mountPath: /secrets/ci-pull-credentials + name: ci-pull-credentials + readOnly: true + - mountPath: /secrets/gcs + name: gcs-credentials + readOnly: true + - mountPath: /secrets/manifest-tool + name: manifest-tool-local-pusher + readOnly: true + - mountPath: /etc/pull-secret + name: pull-secret + readOnly: true + - mountPath: /etc/report + name: result-aggregator + readOnly: true + serviceAccountName: ci-operator + volumes: + - name: boskos + secret: + items: + - key: credentials + path: credentials + secretName: boskos-credentials + - name: ci-pull-credentials + secret: + secretName: ci-pull-credentials + - name: manifest-tool-local-pusher + secret: + secretName: manifest-tool-local-pusher + - name: pull-secret + secret: + secretName: registry-pull-credentials + - name: result-aggregator + secret: + secretName: result-aggregator + trigger: (?m)^/test( | .* )e2e-aws-operator,?($|\s.*) - agent: kubernetes always_run: false branches: