Skip to content

Instantly share code, notes, and snippets.

@liweinan
Created January 27, 2026 06:46
Show Gist options
  • Select an option

  • Save liweinan/1c16388052387032931c1846035d8052 to your computer and use it in GitHub Desktop.

Select an option

Save liweinan/1c16388052387032931c1846035d8052 to your computer and use it in GitHub Desktop.
Analyze installer versions and their corresponding commits
#!/bin/bash
# Analyze installer versions and their corresponding commits
# Similar to release image analysis, but for installer repository
set -e
INSTALLER_REPO="${1:-/Users/weli/works/oc-swarm/installer}"
echo "=========================================="
echo "Installer Version Analysis"
echo "=========================================="
echo "Repository: $INSTALLER_REPO"
echo ""
cd "$INSTALLER_REPO"
# Method 1: Check release branches
echo "=== Method 1: Release Branches ==="
for branch in release-4.16 release-4.17 release-4.18 release-4.19 release-4.20; do
if git show-ref --verify --quiet refs/remotes/origin/$branch; then
commit=$(git rev-parse origin/$branch)
date=$(git log -1 --format="%cd" --date=short origin/$branch)
echo "$branch: $commit ($date)"
fi
done
echo ""
# Method 2: Check if bug commit exists in each branch
echo "=== Method 2: Bug Commit (4068682841) Check ==="
BUG_COMMIT="4068682841"
for branch in release-4.16 release-4.17 release-4.18 release-4.19 release-4.20; do
if git branch -r --contains "$BUG_COMMIT" 2>/dev/null | grep -q "$branch"; then
echo "$branch: ❌ Contains bug commit"
else
echo "$branch: ✅ No bug (safe)"
fi
done
echo ""
# Method 3: Find commits that mention version numbers
echo "=== Method 3: Version-related Commits ==="
for version in 4.16 4.17 4.18 4.19 4.20; do
echo "--- Version $version ---"
git log --all --oneline --grep="$version" --grep="release.*$version" -i -3 --format="%h %ad %s" --date=short | head -3 || echo " (no specific commits found)"
done
echo ""
# Method 4: Check default release image in code
echo "=== Method 4: Default Release Image in Code ==="
if [ -f "pkg/asset/releaseimage/default.go" ]; then
echo "Current default release image:"
grep -A 2 "defaultReleaseImageOriginal" pkg/asset/releaseimage/default.go | head -3 || echo " (not found)"
else
echo " File not found"
fi
echo ""
# Method 5: Analyze by checking when release image changed
echo "=== Method 5: Release Image Changes ==="
git log --all --oneline --grep="release.*4\.[12]" -i --format="%h %ad %s" --date=short -- pkg/asset/releaseimage/default.go | head -10 || echo " (no changes found)"
echo ""
# Method 6: Check tags
echo "=== Method 6: Version Tags ==="
git tag | grep -E "^v?4\.(1[6-9]|20)" | sort -V | tail -10
echo ""
# Method 7: Find commits before bug introduction
echo "=== Method 7: Commits Before Bug Introduction (2025-08-14) ==="
BUG_DATE="2025-08-14"
for branch in release-4.16 release-4.17 release-4.18 release-4.19; do
if git show-ref --verify --quiet refs/remotes/origin/$branch; then
last_before_bug=$(git log origin/$branch --before="$BUG_DATE" --oneline -1 --format="%h %ad %s" --date=short 2>/dev/null || echo "")
if [ -n "$last_before_bug" ]; then
echo "$branch: $last_before_bug"
fi
fi
done
echo ""
echo "=========================================="
echo "Summary"
echo "=========================================="
echo "To find installer commit for a specific OpenShift version:"
echo "1. Check release branch: git checkout release-4.19 && git log -1"
echo "2. Check release image: oc adm release info quay.io/openshift-release-dev/ocp-release:4.19.0-x86_64 --image-for=openshift-install"
echo "3. Check if bug exists: git branch -r --contains 4068682841 | grep release-4.19"
echo "=========================================="
@liweinan
Copy link
Author

Using the test script to test against a commit that contains the problem:

cd /Users/weli/works/oc-swarm/my-openshift-workspace/OCPBUGS-69923 && LOG_LEVEL=debug ./test-4.19-zone-consistency.sh /Users/w
eli/works/oc-swarm/installer/bin/openshift-install ~/works/oc-swarm/openshift-versions/auth.json qe.devcluster.openshift.com us-
east-1 2
==========================================
OCPBUGS-69923 Zone Consistency Test (4.19)
==========================================
Installer: /Users/weli/works/oc-swarm/installer/bin/openshift-install
/Users/weli/works/oc-swarm/installer/bin/openshift-install unreleased-master-12138-g4068682841f807383c1ada67691f53cd1f2022bc-dirty
built from commit 4068682841f807383c1ada67691f53cd1f2022bc
release image registry.ci.openshift.org/origin/release:4.20
release architecture unknown
default architecture amd64

Region: us-east-1
Iterations: 2
Work directory: /tmp/test-4.19-zone-consistency
==========================================

==========================================
Iteration 1/2
==========================================
WARNING Release Image Architecture not detected. Release Image Architecture is unknown 
INFO Credentials loaded from the "default" profile in file "/Users/weli/.aws/credentials" 
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
INFO Consuming Install Config from target directory 
INFO Successfully populated MCS CA cert information: root-ca 2036-01-25T07:44:56Z 2026-01-27T07:44:56Z 
INFO Successfully populated MCS TLS cert information: root-ca 2036-01-25T07:44:56Z 2026-01-27T07:44:56Z 
INFO Adding clusters...                           
INFO Manifests created in: /tmp/test-4.19-zone-consistency/iter-1/cluster-api, /tmp/test-4.19-zone-consistency/iter-1/manifests and /tmp/test-4.19-zone-consistency/iter-1/openshift 
  CAPI zones (from cluster-api/machines/10_inframachine_*): us-east-1a us-east-1b us-east-1c
  MAPI zones (from ControlPlaneMachineSet failureDomains): us-east-1a us-east-1b us-east-1c
  PASS
==========================================
Iteration 2/2
==========================================
WARNING Release Image Architecture not detected. Release Image Architecture is unknown 
INFO Credentials loaded from the "default" profile in file "/Users/weli/.aws/credentials" 
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
INFO Consuming Install Config from target directory 
INFO Successfully populated MCS CA cert information: root-ca 2036-01-25T07:45:09Z 2026-01-27T07:45:09Z 
INFO Successfully populated MCS TLS cert information: root-ca 2036-01-25T07:45:09Z 2026-01-27T07:45:09Z 
INFO Adding clusters...                           
INFO Manifests created in: /tmp/test-4.19-zone-consistency/iter-2/cluster-api, /tmp/test-4.19-zone-consistency/iter-2/manifests and /tmp/test-4.19-zone-consistency/iter-2/openshift 
  CAPI zones (from cluster-api/machines/10_inframachine_*): us-east-1a us-east-1b us-east-1c
  MAPI zones (from ControlPlaneMachineSet failureDomains): us-east-1f us-east-1a us-east-1b
  \033[0;31mFAIL: zones mismatch - CAPI and MAPI have different zone assignments\033[0m


==========================================
Final Result: 2 iterations completed
==========================================
Total failures: 1
Failure rate: 50.00%

Failure details:

Iteration 2:
  CAPI: us-east-1a us-east-1b us-east-1c
  MAPI: us-east-1f us-east-1a us-east-1b

Failed iterations saved in: /tmp/test-4.19-zone-consistency/fail-*
Conclusion: BUG DETECTED in this installer version!
==========================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment