diff --git a/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-commands.sh b/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-commands.sh index 97178112804aa..3064d72b94daf 100644 --- a/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-commands.sh +++ b/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-commands.sh @@ -28,7 +28,17 @@ echo -n '{"auths": {"quay.io/mcoqe": {"auth": "'"$(base64 -w 0 /var/run/vault/mc # Add the mcoqe credentials to the custer's pull-secret echo "Merge mcoqe credentials and the global cluster pull secret" -jq -s '.[0] * .[1]' "$cluster_pull_secret_file" "$mcoqe_pull_secret_file" > "$merged_pull_secret_file" +python3 -c " +import json, sys +def deep_merge(a, b): + r = dict(a) + for k, v in b.items(): + r[k] = deep_merge(a.get(k, {}), v) if isinstance(v, dict) else v + return r +with open(sys.argv[1]) as f: a = json.load(f) +with open(sys.argv[2]) as f: b = json.load(f) +print(json.dumps(deep_merge(a, b))) +" "$cluster_pull_secret_file" "$mcoqe_pull_secret_file" > "$merged_pull_secret_file" # Update the cluster's pull-secret with the new value echo "Update the global cluster pull secret with the new merged credentials" diff --git a/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-ref.yaml b/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-ref.yaml index 163d87fb23181..ea954c490a069 100644 --- a/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-ref.yaml +++ b/ci-operator/step-registry/mco/conf/day2/add-mcoqe-robot-to-pull-secret/mco-conf-day2-add-mcoqe-robot-to-pull-secret-ref.yaml @@ -1,6 +1,6 @@ ref: as: mco-conf-day2-add-mcoqe-robot-to-pull-secret - from: upi-installer + from: cli cli: latest commands: mco-conf-day2-add-mcoqe-robot-to-pull-secret-commands.sh resources: