Skip to content

Commit ac8bcc6

Browse files
kaovilaiclaude
andcommitted
fix(e2e): derive must-gather directory pattern from image name
The directory pattern was hardcoded to 'quay-io-konveyor-oadp-must-gather-*' which breaks when using custom images via MUST_GATHER_IMAGE env var. Now dynamically derives the pattern from the actual image name by replacing registry separators (. / :) with hyphens to match oc adm must-gather's directory naming convention. Examples: - quay.io/konveyor/oadp-must-gather:latest -> quay-io-konveyor-oadp-must-gather-latest-* - docker.io/myuser/custom:v1 -> docker-io-myuser-custom-v1-* 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f352b31 commit ac8bcc6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/e2e/lib/apps.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,13 @@ func RunMustGather(artifact_dir string, clusterClient client.Client) error {
409409
clusterID := string(clusterVersion.Spec.ClusterID[:8])
410410

411411
// Find the must-gather output directory
412-
// oc adm must-gather creates: <artifact_dir>/quay-io-konveyor-oadp-must-gather-*/clusters/<cluster-id>/
413-
pattern := filepath.Join(artifact_dir, "quay-io-konveyor-oadp-must-gather-*", "clusters", clusterID, "oadp-must-gather-summary.md")
412+
// oc adm must-gather creates a directory based on the image name with registry separators
413+
// replaced by hyphens. E.g., quay.io/konveyor/oadp-must-gather:latest -> quay-io-konveyor-oadp-must-gather-*
414+
// We need to derive the pattern from the actual image being used
415+
imagePattern := strings.ReplaceAll(mustGatherImage, ":", "-")
416+
imagePattern = strings.ReplaceAll(imagePattern, "/", "-")
417+
imagePattern = strings.ReplaceAll(imagePattern, ".", "-")
418+
pattern := filepath.Join(artifact_dir, imagePattern+"-*", "clusters", clusterID, "oadp-must-gather-summary.md")
414419
matches, err := filepath.Glob(pattern)
415420
if err != nil {
416421
return fmt.Errorf("error finding must-gather summary: %w", err)

0 commit comments

Comments
 (0)