Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
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
2 changes: 1 addition & 1 deletion scripts/prepare-fulfillment-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if [[ -n "${INSTALLER_VM_TEMPLATE}" || -n "${INSTALLER_CLUSTER_TEMPLATE}" ]]; th
JOB_ID=""
for attempt in $(seq 1 10); do
LAUNCH_ERR=$(mktemp)
JOB_RESPONSE=$(curl -kfsS -X POST -H "Authorization: Bearer ${AAP_TOKEN}" -H "Content-Type: application/json" \
JOB_RESPONSE=$(curl -ksS -X POST -H "Authorization: Bearer ${AAP_TOKEN}" -H "Content-Type: application/json" \
"${AAP_URL}/api/controller/v2/job_templates/${JT_ID}/launch/" 2>"${LAUNCH_ERR}") && {
JOB_ID=$(echo "${JOB_RESPONSE}" | jq -r '.id // empty')
[[ -n "${JOB_ID}" && "${JOB_ID}" != "null" ]] && break
Expand Down
37 changes: 9 additions & 28 deletions scripts/refresh-after-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,39 +280,20 @@ for i in "${!img_check_pids[@]}"; do
fi
done

# Discover fulfillment deployments by label instead of maintaining a hardcoded
# list. The app=fulfillment-service label is set by kustomize on all
# fulfillment-service resources, so new deployments are picked up automatically.
read -ra FULFILLMENT_DEPLOYS <<< \
"$(oc get deploy -n "${INSTALLER_NAMESPACE}" -l app=fulfillment-service \
-o jsonpath='{.items[*].metadata.name}')"
if [[ ${#FULFILLMENT_DEPLOYS[@]} -eq 0 || -z "${FULFILLMENT_DEPLOYS[0]}" ]]; then
echo "ERROR: No deployments found with label app=fulfillment-service in namespace ${INSTALLER_NAMESPACE}"
exit 1
fi
echo " Fulfillment deployments: ${FULFILLMENT_DEPLOYS[*]}"

echo "[5/9] Waiting for TLS certificates and restarting pods..."
refresh_cdi_certificates &
pid_cdi=$!
pids=()
read -ra fs_certs <<< \
"$(oc get certificates.cert-manager.io -n "${INSTALLER_NAMESPACE}" \
-l app=fulfillment-service -o jsonpath='{.items[*].metadata.name}')"
if [[ ${#fs_certs[@]} -eq 0 || -z "${fs_certs[0]}" ]]; then
echo "ERROR: No certificates found with label app=fulfillment-service in namespace ${INSTALLER_NAMESPACE}"
exit 1
fi
echo " Certificates to wait for: ${fs_certs[*]}"
for cert in "${fs_certs[@]}"; do
oc wait --for=condition=Ready "certificate.cert-manager.io/${cert}" \
-n "${INSTALLER_NAMESPACE}" --timeout=300s &
for cert in authorino fulfillment-controller fulfillment-grpc-server fulfillment-api \
fulfillment-rest-gateway fulfillment-database-client fulfillment-database-server \
osac-console-proxy; do
oc wait --for=condition=Ready "certificate.cert-manager.io/${cert}" -n "${INSTALLER_NAMESPACE}" --timeout=300s &
pids+=($!)
done
# Kustomize apply may have changed deployment images, triggering new rollouts
# that run DB migrations. Wait for those to finish before restarting pods —
# otherwise the restart kills pods mid-migration and leaves the DB dirty.
for deploy in "${FULFILLMENT_DEPLOYS[@]}"; do
for deploy in fulfillment-controller fulfillment-grpc-server fulfillment-rest-gateway fulfillment-ingress-proxy; do
oc rollout status "deploy/${deploy}" -n "${INSTALLER_NAMESPACE}" --timeout=300s &
pids+=($!)
done
Expand All @@ -321,7 +302,7 @@ for pid in "${pids[@]}"; do wait "${pid}" || failed=1; done
wait ${pid_cdi} || failed=1
if (( failed )); then echo "ERROR: TLS certificates or fulfillment rollouts not ready"; exit 1; fi
echo "[5/9] TLS certificates ready, restarting pods..."
for deploy in "${FULFILLMENT_DEPLOYS[@]}"; do
for deploy in fulfillment-controller fulfillment-grpc-server fulfillment-rest-gateway fulfillment-ingress-proxy; do
oc rollout restart "deploy/${deploy}" -n "${INSTALLER_NAMESPACE}"
done
if oc get deploy assisted-service -n multicluster-engine &>/dev/null; then
Expand All @@ -334,7 +315,7 @@ fi

wait_fulfillment_rollouts() {
pids=()
for deploy in "${FULFILLMENT_DEPLOYS[@]}"; do
for deploy in fulfillment-controller fulfillment-grpc-server fulfillment-rest-gateway fulfillment-ingress-proxy; do
oc rollout status "deploy/${deploy}" -n "${INSTALLER_NAMESPACE}" --timeout=300s &
pids+=($!)
done
Expand Down Expand Up @@ -407,11 +388,11 @@ echo "[8/9] Configuring AAP access and fulfillment service..."
./scripts/prepare-fulfillment-service.sh

echo "[9/9] Restarting fulfillment pods and configuring tenant..."
for deploy in "${FULFILLMENT_DEPLOYS[@]}"; do
for deploy in fulfillment-controller fulfillment-grpc-server fulfillment-rest-gateway fulfillment-ingress-proxy; do
oc rollout restart "deploy/${deploy}" -n "${INSTALLER_NAMESPACE}"
done
pids=()
for deploy in "${FULFILLMENT_DEPLOYS[@]}"; do
for deploy in fulfillment-controller fulfillment-grpc-server fulfillment-rest-gateway fulfillment-ingress-proxy; do
oc rollout status "deploy/${deploy}" -n "${INSTALLER_NAMESPACE}" --timeout=300s &
pids+=($!)
done
Expand Down
Loading