@@ -42,6 +42,12 @@ export KO_FLAGS="${KO_FLAGS:-}"
4242export INGRESS_CLASS=${INGRESS_CLASS:- istio.ingress.networking.knative.dev}
4343export TIMEOUT_CI=30m
4444
45+ : " ${MC_PROVIDER_CONFIGMAP:= clusterprofile-provider-file} "
46+ : " ${MC_PROVIDER_MOUNT_PATH:=/ etc/ cluster-inventory} "
47+ : " ${MC_PROVIDER_PLUGIN_MOUNT_PATH:=/ etc/ cluster-inventory/ plugin} "
48+ : " ${MC_PROVIDER_PLUGIN_IMAGE:= registry.k8s.io/ cluster-inventory-api/ secretreader: v0.1.3} "
49+ : " ${MC_PROVIDER_NAME:= secretreader} "
50+
4551# Boolean used to indicate whether to generate serving YAML based on the latest code in the branch KNATIVE_SERVING_REPO_BRANCH.
4652GENERATE_SERVING_YAML=0
4753
@@ -464,8 +470,9 @@ function apply_cluster_profile() {
464470 SPOKE_INTERNAL_ENDPOINT=" ${spoke_endpoint} " \
465471 SPOKE_CA_DATA_B64=" ${spoke_ca_b64} " \
466472 MC_PROVIDER_NAME=" ${MC_PROVIDER_NAME} " \
473+ SPOKE_CLUSTER_NAME=" ${SPOKE_CLUSTER_NAME} " \
467474 TRANSITION=" $( date -u +%FT%TZ) " \
468- envsubst ' ${SPOKE_INTERNAL_ENDPOINT} ${SPOKE_CA_DATA_B64} ${MC_PROVIDER_NAME} ${TRANSITION}' \
475+ envsubst ' ${SPOKE_INTERNAL_ENDPOINT} ${SPOKE_CA_DATA_B64} ${MC_PROVIDER_NAME} ${SPOKE_CLUSTER_NAME} ${ TRANSITION}' \
469476 < test/config/multicluster/clusterprofile-status.yaml.tmpl \
470477 > " ${status_file} " || return 1
471478
@@ -477,23 +484,14 @@ function apply_cluster_profile() {
477484}
478485
479486function install_access_provider_config() {
480- echo " >> Building token-exec-plugin image via ko"
481- local plugin_image
482- plugin_image=" $( ko build ./test/cmd/token-exec-plugin) " || return 1
483- if [[ -z " ${plugin_image} " ]]; then
484- echo " ERROR: ko build did not emit an image reference for token-exec-plugin" >&2
485- return 1
486- fi
487- echo " >> token-exec-plugin image: ${plugin_image} "
488-
489487 echo " >> Installing access provider ConfigMap/Secret and patching operator deployment"
490488 local tmpdir
491489 tmpdir=" $( mktemp -d) " || return 1
492490 add_trap " rm -rf ${tmpdir} " EXIT
493491 local token_file=" ${tmpdir} /token"
494492 _spoke_bootstrap_token " ${token_file} " || return 1
495493
496- local plugin_command=" ${MC_PROVIDER_PLUGIN_MOUNT_PATH} /ko-app/token-exec -plugin"
494+ local plugin_command=" ${MC_PROVIDER_PLUGIN_MOUNT_PATH} /bin/secretreader -plugin"
497495 cat > " ${tmpdir} /provider-config.json" << EOF
498496{
499497 "providers": [
@@ -502,7 +500,7 @@ function install_access_provider_config() {
502500 "execConfig": {
503501 "apiVersion": "client.authentication.k8s.io/v1",
504502 "command": "${plugin_command} ",
505- "args ": [" ${MC_PROVIDER_TOKEN_MOUNT_PATH} /token"] ,
503+ "provideClusterInfo ": true ,
506504 "interactiveMode": "Never"
507505 }
508506 }
@@ -514,24 +512,21 @@ EOF
514512 --from-file=config.json=" ${tmpdir} /provider-config.json" \
515513 --dry-run=client -o yaml | kubectl apply -f - || return 1
516514
517- kubectl -n " ${TEST_OPERATOR_NAMESPACE} " create secret generic " ${MC_PROVIDER_TOKEN_SECRET } " \
515+ kubectl -n " ${TEST_OPERATOR_NAMESPACE} " create secret generic " ${SPOKE_CLUSTER_NAME } " \
518516 --from-file=token=" ${token_file} " \
519517 --dry-run=client -o yaml | kubectl apply -f - || return 1
520518
521- # 0444
522519 kubectl -n " ${TEST_OPERATOR_NAMESPACE} " patch deployment knative-operator \
523520 --type=json \
524521 -p " $( cat << EOF
525522[
526523 {"op": "add", "path": "/spec/template/spec/containers/0/args", "value": ["--clusterprofile-provider-file=${MC_PROVIDER_MOUNT_PATH} /config.json"]},
527524 {"op": "add", "path": "/spec/template/spec/volumes", "value": [
528525 {"name": "access-config", "configMap": {"name": "${MC_PROVIDER_CONFIGMAP} "}},
529- {"name": "provider-token", "secret": {"secretName": "${MC_PROVIDER_TOKEN_SECRET} ", "defaultMode": 292}},
530- {"name": "access-plugin", "image": {"reference": "${plugin_image} ", "pullPolicy": "IfNotPresent"}}
526+ {"name": "access-plugin", "image": {"reference": "${MC_PROVIDER_PLUGIN_IMAGE} ", "pullPolicy": "IfNotPresent"}}
531527 ]},
532528 {"op": "add", "path": "/spec/template/spec/containers/0/volumeMounts", "value": [
533529 {"name": "access-config", "mountPath": "${MC_PROVIDER_MOUNT_PATH} ", "readOnly": true},
534- {"name": "provider-token", "mountPath": "${MC_PROVIDER_TOKEN_MOUNT_PATH} ", "readOnly": true},
535530 {"name": "access-plugin", "mountPath": "${MC_PROVIDER_PLUGIN_MOUNT_PATH} ", "readOnly": true}
536531 ]}
537532]
0 commit comments