diff --git a/hack/e2e-pool-test.sh b/hack/e2e-pool-test.sh index c43ccd97afa..43cdaa49607 100755 --- a/hack/e2e-pool-test.sh +++ b/hack/e2e-pool-test.sh @@ -215,7 +215,12 @@ go run "${SRC_ROOT}/contrib/cmd/hiveutil/main.go" clusterpool create-pool \ --pull-secret-file="${PULL_SECRET_FILE}" \ --image-set "${IMAGESET_NAME}" \ --region us-east-1 \ - --size "${POOL_SIZE}" \ + # NOTE: We start with a zero-size pool and scale it up after we add the inventory. + # Otherwise, adding the inventory immediately makes the already-provisioning cluster + # stale, BUT it doesn't get purged until it's done provisioning. (Intentional + # architectural decision to prefer presenting a stale claimable cluster early vs. + # delaying until a non-stale one is available.) + --size 0 \ ${REAL_POOL_NAME} ### INTERLUDE: FAKE POOL @@ -234,7 +239,8 @@ oc get clusterpool ${REAL_POOL_NAME} -o json \ NEW_CLUSTER_NAME=cdcci-${CLUSTER_NAME#*-} create_customization "cdc-test" "${CLUSTER_NAMESPACE}" "${NEW_CLUSTER_NAME}" oc patch cp -n $CLUSTER_NAMESPACE $REAL_POOL_NAME --type=merge -p '{"spec": {"inventory": [{"name": "cdc-test"}]}}' - +# Now we can scale up the pool so it starts creating clusters +oc scale cp -n $CLUSTER_NAMESPACE $REAL_POOL_NAME --replicas=$POOL_SIZE wait_for_pool_to_be_ready $FAKE_POOL_NAME