From 4025f4a9704cbd3adcf8ac421111f3f048f606c1 Mon Sep 17 00:00:00 2001 From: enxebre Date: Mon, 26 Sep 2022 17:54:10 +0200 Subject: [PATCH] Let cluster-bot use regular ci aws account for hypershift guest clusters --- .../release/openshift-release-infra-periodics.yaml | 1 + ...hift-aws-setup-nested-management-cluster-chain.yaml | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ci-operator/jobs/openshift/release/openshift-release-infra-periodics.yaml b/ci-operator/jobs/openshift/release/openshift-release-infra-periodics.yaml index 59b7ea288b515..995a3c016ad9d 100644 --- a/ci-operator/jobs/openshift/release/openshift-release-infra-periodics.yaml +++ b/ci-operator/jobs/openshift/release/openshift-release-infra-periodics.yaml @@ -2674,6 +2674,7 @@ periodics: HYPERSHIFT_NODE_COUNT: 2 HYPERSHIFT_ZONES: "us-east-1a" HYPERSHIFT_NAMESPACE: "cluster-bot" + HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT: "true" test: - ref: clusterbot-wait cluster_profile: hypershift diff --git a/ci-operator/step-registry/hypershift/aws/setup-nested-management-cluster/hypershift-aws-setup-nested-management-cluster-chain.yaml b/ci-operator/step-registry/hypershift/aws/setup-nested-management-cluster/hypershift-aws-setup-nested-management-cluster-chain.yaml index 6f6896a0cef3a..2865e18c164a6 100644 --- a/ci-operator/step-registry/hypershift/aws/setup-nested-management-cluster/hypershift-aws-setup-nested-management-cluster-chain.yaml +++ b/ci-operator/step-registry/hypershift/aws/setup-nested-management-cluster/hypershift-aws-setup-nested-management-cluster-chain.yaml @@ -13,13 +13,21 @@ chain: - name: HYPERSHIFT_ZONES default: "us-east-1a,us-east-1b,us-east-1c" documentation: "The zones where to create NodePools" + - name: HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT + default: "false" + documentation: "Whether to use the generic CI account or the HyperShift OSD account for the guest clusters infra. For the infra created for the clusters. E.g. For cluster-bot we use the generic CI account" commands: |- + AWS_GUEST_INFRA_CREDENTIALS_FILE="/etc/hypershift-ci-jobs-awscreds/credentials" + if [[ "HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT" == "true" ]]; then + AWS_GUEST_INFRA_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred" + fi + export KUBECONFIG=/etc/hypershift-kubeconfig/hypershift-ops-admin.kubeconfig CLUSTER_NAME="$(echo -n $PROW_JOB_ID|sha256sum|cut -c-20)-mgmt" echo "Creating management cluster ${CLUSTER_NAME} with $((${HYPERSHIFT_NODE_COUNT} * 3)) nodes" bin/hypershift create cluster aws \ --pull-secret=/etc/ci-pull-credentials/.dockerconfigjson \ - --aws-creds=/etc/hypershift-ci-jobs-awscreds/credentials \ + --aws-creds=${AWS_GUEST_INFRA_CREDENTIALS_FILE} \ --additional-tags="expirationDate=$(date -d '4 hours' --iso=minutes --utc)" \ --name=${CLUSTER_NAME} \ --region=us-east-1 \