Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ tests:
env:
TEST_FILTERS: ~DisconnectedOnly&;~HyperShiftMGMT&;~MicroShiftOnly&;~NonHyperShiftHOST&
test:
- ref: cucushift-hypershift-extended-mirror-release-images-to-acr-upgrade
- chain: openshift-upgrade-qe-test-hypershift
workflow: cucushift-installer-rehearse-azure-aks-hypershift-registry-overrides-guest
- as: azure-ipi-confidential-trustedlaunch-f28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ tests:
env:
TEST_FILTERS: ~DisconnectedOnly&;~HyperShiftMGMT&;~MicroShiftOnly&;~NonHyperShiftHOST&
test:
- ref: cucushift-hypershift-extended-mirror-release-images-to-acr-upgrade
- chain: openshift-upgrade-qe-test-hypershift
workflow: cucushift-installer-rehearse-azure-aks-hypershift-registry-overrides-guest
- as: azure-ipi-confidential-trustedlaunch-f28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ openshifttest_auth_password="$(jq -r '.password' '/var/run/vault/mirror-registry
openshifttest_registry_auth="$(echo -n "${openshifttest_auth_user}:${openshifttest_auth_password}" | base64 -w 0)"

# acr auth
acr_login_server="$(</var/run/vault/acr-pull-credentials/loginserver)"
acr_user="$(</var/run/vault/acr-pull-credentials/username)"
acr_password="$(</var/run/vault/acr-pull-credentials/password)"
acr_login_server="$(</var/run/vault/preservehypershiftaks/loginserver)"
acr_user="$(</var/run/vault/preservehypershiftaks/username)"
acr_password="$(</var/run/vault/preservehypershiftaks/password)"
acr_auth="$(echo -n "${acr_user}:${acr_password}" | base64 -w 0)"

echo "Merging extra auth info into the existing pull secret"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ref:
name: ci-pull-credentials
mount_path: /var/run/vault/ci-pull-credentials
- namespace: test-credentials
name: arohcpdev-acr-hypershift-team
mount_path: /var/run/vault/acr-pull-credentials
name: hypershift-acr-preservehypershiftaks
mount_path: /var/run/vault/preservehypershiftaks
documentation: |-
Merges additional authentication information into the existing pull secret.
The result is saved to "${SHARED_DIR}/hypershift-pull-secret".
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,12 @@ function check_resources_using_image_from_repo() {
local repo="$2"
local result

echo "Checking resources using images from repository $repo"
result=$(eval "oc get $RESOURCE_TYPES $namespace_arg -o json" | \
jq -r --arg repo "$repo" \
'.items[] | select(.spec.template.spec.containers[].image | startswith($repo)) | "\(.kind) -n \(.metadata.namespace) \(.metadata.name)"')

if [[ -n "$result" ]]; then
printf "Found the following resources using image from repository %s:\n%s\n" "$repo" "$result" >&2
return 1
fi
}

function check_node_images_from_repo() {
local repo="$1"
local result

echo "Checking node images from repository $repo"
result="$(oc get node -o jsonpath='{.items[*].status.images[*].names[*]}' | tr ' ' '\n')"
if grep "$repo" <<< "$result" &>/dev/null; then
printf "Found the following node images from repository %s:\n%s\n" "$repo" "$result" >&2
printf "Found the following resources using image from repository %s:\n%s" "$repo" "$result" >&2
return 1
fi
}
Expand Down Expand Up @@ -74,7 +61,6 @@ fi
RESOURCE_TYPES="deployments,daemonsets,statefulsets"
for src_repo in "${SRC_LIST[@]}"; do
check_resources_using_image_from_repo "-n $CLUSTER_NAMESPACE" "$src_repo"
check_node_images_from_repo "$src_repo"
done

# TODO: check data plane once https://issues.redhat.com/browse/OCPBUGS-41365 is resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

set -euxo pipefail

# Generate registry overrides file
ACR_LOGIN_SERVER="$(</var/run/vault/acr-pull-credentials/loginserver)"
# Registry overrides
REGISTRY_OVERRIDES_FILE="$SHARED_DIR"/hypershift_operator_registry_overrides
cat <<EOF >> "$REGISTRY_OVERRIDES_FILE"
quay.io/openshift-release-dev/ocp-v4.0-art-dev=$ACR_LOGIN_SERVER/openshift-release-dev/ocp-v4.0-art-dev
quay.io/openshift-release-dev/ocp-release=$ACR_LOGIN_SERVER/openshift-release-dev/ocp-release
EOF
if [[ ! -f "$REGISTRY_OVERRIDES_FILE" ]]; then
echo "Registry override file $REGISTRY_OVERRIDES_FILE not found, exiting" >&2
exit 1
fi

# Get registry overrides from file
REGISTRY_OVERRIDES=""
while read -r line || [[ -n "$line" ]]; do
if [[ -z $line ]]; then
Expand All @@ -30,6 +28,5 @@ oc patch deployment operator -n hypershift --type=json -p='[
"value": "'"--registry-overrides=$REGISTRY_OVERRIDES"'"
}
]'
oc wait deployment operator -n hypershift --for='condition=PROGRESSING=True' --timeout=1m
oc rollout status deployment -n hypershift operator --timeout=5m
oc wait deployment -n hypershift operator --for=condition=Available --timeout=5m

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,5 @@ ref:
requests:
cpu: 100m
memory: 100Mi
credentials:
- namespace: test-credentials
name: arohcpdev-acr-hypershift-team
mount_path: /var/run/vault/acr-pull-credentials
documentation: |-
Add the `--registry-overrides` flag to the HO deployment and wait for the deployment to become ready.
Also creates the "$SHARED_DIR"/hypershift_operator_registry_overrides file for later use.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ chain:
- ref: hypershift-azure-aks-attach-kv
- ref: azure-provision-resourcegroup
- ref: cucushift-hypershift-extended-enable-qe-pull-secret-day-one
- ref: cucushift-hypershift-extended-mirror-release-images-to-acr
- ref: cucushift-hypershift-extended-k8s-mgmt-apply-crds
- ref: cucushift-hypershift-extended-install-private
- ref: cucushift-hypershift-extended-registry-overrides-patch-hypershift-operator
Expand Down