diff --git a/test/extended/cli/mustgather.go b/test/extended/cli/mustgather.go index e22228a1f9e7..6865c75bb932 100644 --- a/test/extended/cli/mustgather.go +++ b/test/extended/cli/mustgather.go @@ -605,35 +605,17 @@ var _ = g.Describe("[sig-cli] oc adm must-gather", func() { // Check if gather.logs exists in the directory for default must-gather image checkGatherLogsForImage(tempDir) - // Check if gather.logs exists in the directory for CNV image - // Note: registry.redhat.io may not be accessible in CI environments, so we skip if the image pull fails - err = oc.AsAdmin().WithoutNamespace().Run("adm").Args("must-gather", "--image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.0", "--dest-dir="+tempDir1).Execute() - if err != nil { - errMsg := err.Error() - isPullError := strings.Contains(errMsg, "pull") && (strings.Contains(errMsg, "manifest unknown") || strings.Contains(errMsg, "not found")) - if isPullError { - e2e.Logf("Skipping CNV must-gather image test - image pull failed (likely not accessible in CI environment): %v", err) - } else { - o.Expect(err).NotTo(o.HaveOccurred(), "must-gather failed with non-pull error") - } - } else { - checkGatherLogsForImage(tempDir1) - } - - // Check if gather.logs exists for both the images when passed to must-gather - // Note: registry.redhat.io may not be accessible in CI environments, so we skip if the image pull fails - err = oc.AsAdmin().WithoutNamespace().Run("adm").Args("must-gather", "--image-stream=openshift/must-gather", "--image=registry.redhat.io/container-native-virtualization/cnv-must-gather-rhel9:v4.15.0", "--dest-dir="+tempDir2).Execute() - if err != nil { - errMsg := err.Error() - isPullError := strings.Contains(errMsg, "pull") && (strings.Contains(errMsg, "manifest unknown") || strings.Contains(errMsg, "not found")) - if isPullError { - e2e.Logf("Skipping multi-image must-gather test with CNV - image pull failed (likely not accessible in CI environment): %v", err) - } else { - o.Expect(err).NotTo(o.HaveOccurred(), "must-gather failed with non-pull error") - } - } else { - checkGatherLogsForImage(tempDir2) - } + // Check if gather.logs exists in the directory when using --image-stream + // Use the CI-accessible openshift/must-gather imagestream instead of external registry images + err = oc.AsAdmin().WithoutNamespace().Run("adm").Args("must-gather", "--image-stream=openshift/must-gather", "--dest-dir="+tempDir1).Execute() + o.Expect(err).NotTo(o.HaveOccurred(), "must-gather with imagestream should succeed") + checkGatherLogsForImage(tempDir1) + + // Check if gather.logs exists for multiple imagestreams when passed to must-gather + // This tests the multi-image functionality using CI-accessible imagestreams + err = oc.AsAdmin().WithoutNamespace().Run("adm").Args("must-gather", "--image-stream=openshift/must-gather", "--image-stream=openshift/must-gather", "--dest-dir="+tempDir2).Execute() + o.Expect(err).NotTo(o.HaveOccurred(), "must-gather with multiple imagestreams should succeed") + checkGatherLogsForImage(tempDir2) }) })