Skip to content

Commit

Permalink
remove special condition for workload id for conformance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nojnhuh committed Sep 10, 2024
1 parent befe2f4 commit 0d48ce1
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions scripts/kind-with-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,34 +203,22 @@ function upload_to_blob() {
# to be mounted on the kind cluster and hence extra mount flags are required.
function createKindForAZWI() {
echo "creating workload-identity-enabled kind configuration"
if [ -n "${CONFORMANCE_FLAVOR}" ] && [ -n "${SERVICE_ACCOUNT_SIGNING_PUB}" ] && [ -n "${SERVICE_ACCOUNT_SIGNING_KEY}" ]; then
echo "using pre-existing service-account-issuer for kind cluster"
KIND_SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH="${REPO_ROOT}/kind-wi-sa.pub"
KIND_SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH="${REPO_ROOT}/kind-wi-sa.key"
echo "${SERVICE_ACCOUNT_SIGNING_PUB}" > "${KIND_SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH}"
echo "${SERVICE_ACCOUNT_SIGNING_KEY}" > "${KIND_SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH}"
KIND_SERVICE_ACCOUNT_ISSUER="https://oidcissuercapzci.blob.core.windows.net/oidc-capzci/"
else
KIND_SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH="${SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH}"
KIND_SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH="${SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH}"
KIND_SERVICE_ACCOUNT_ISSUER="${SERVICE_ACCOUNT_ISSUER}"
fi
cat <<EOF | "${KIND}" create cluster --name "${KIND_CLUSTER_NAME}" --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: "${KIND_SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH}"
- hostPath: "${SERVICE_ACCOUNT_SIGNING_PUB_FILEPATH}"
containerPath: /etc/kubernetes/pki/sa.pub
- hostPath: "${KIND_SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH}"
- hostPath: "${SERVICE_ACCOUNT_SIGNING_KEY_FILEPATH}"
containerPath: /etc/kubernetes/pki/sa.key
kubeadmConfigPatches:
- |
kind: ClusterConfiguration
apiServer:
extraArgs:
service-account-issuer: ${KIND_SERVICE_ACCOUNT_ISSUER}
service-account-issuer: ${SERVICE_ACCOUNT_ISSUER}
service-account-key-file: /etc/kubernetes/pki/sa.pub
service-account-signing-key-file: /etc/kubernetes/pki/sa.key
controllerManager:
Expand Down

0 comments on commit 0d48ce1

Please sign in to comment.