Skip to content

Commit 42ca197

Browse files
addressed comments
1 parent 4d4accf commit 42ca197

1 file changed

Lines changed: 33 additions & 3 deletions

File tree

test/extended/cli/admin.go

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,11 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
566566
ctx := context.Background()
567567
isHyperShift, hsErr := exutil.IsHypershift(ctx, oc.AdminConfigClient())
568568
o.Expect(hsErr).NotTo(o.HaveOccurred())
569-
if isHyperShift {
570-
g.Skip("Skipping on HyperShift: image extraction requires external outbound access to registry")
569+
errorText := fmt.Sprintf("release extract err=%v output=%s", err, out)
570+
if isHyperShift && cliOutputSuggestsNetworkIsolation(errorText) {
571+
g.Skip("Skipping on HyperShift: `oc adm release extract` failed due to likely outbound network reachability issues to the release image registry (expected in some restricted VPC environments without mirrors)")
571572
}
572-
o.Expect(err).NotTo(o.HaveOccurred(), "oc adm release extract failed on a standard cluster")
573+
o.Expect(err).NotTo(o.HaveOccurred(), "oc adm release extract failed where registry reachability appears healthy; details: %s", errorText)
573574
}
574575
o.Expect(out).To(o.ContainSubstring(`"kind": "ImageStream"`))
575576
o.Expect(out).To(o.ContainSubstring(`"apiVersion": "image.openshift.io/v1"`))
@@ -659,3 +660,32 @@ func randomNode(oc *exutil.CLI) string {
659660
o.Expect(err).NotTo(o.HaveOccurred())
660661
return nodes.Items[rand.Intn(len(nodes.Items))].Name
661662
}
663+
664+
// cliOutputSuggestsNetworkIsolation returns true when command output contains
665+
// errors typical of blocked egress or DNS/connectivity failures.
666+
func cliOutputSuggestsNetworkIsolation(output string) bool {
667+
lowerOutput := strings.ToLower(output)
668+
networkHints := []string{
669+
"connection refused",
670+
"connection reset by peer",
671+
"context deadline exceeded",
672+
"dial tcp",
673+
"i/o timeout",
674+
"no route to host",
675+
"network is unreachable",
676+
"tls handshake timeout",
677+
"temporary failure in name resolution",
678+
"failed to resolve",
679+
"name or service not known",
680+
"lookup ",
681+
"rpc error",
682+
"code = unavailable",
683+
"unavailable: connection",
684+
}
685+
for _, hint := range networkHints {
686+
if strings.Contains(lowerOutput, hint) {
687+
return true
688+
}
689+
}
690+
return false
691+
}

0 commit comments

Comments
 (0)