Skip to content

Commit 4112b55

Browse files
addressed review comments
1 parent e6cc720 commit 4112b55

1 file changed

Lines changed: 8 additions & 45 deletions

File tree

test/extended/cli/admin.go

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -550,28 +550,20 @@ var _ = g.Describe("[sig-cli] oc adm", func() {
550550
o.Expect(err).NotTo(o.HaveOccurred(), "Failed to get current payload image from clusterversion")
551551
payloadImage = strings.TrimSpace(payloadImage)
552552
o.Expect(payloadImage).NotTo(o.BeEmpty())
553-
var out string
554-
cleanup, regArgs, prepErr := exutil.PrepareImagePullSecretAndCABundle(ocns)
553+
cleanup, regArgs, err := exutil.PrepareImagePullSecretAndCABundle(ocns)
555554
if cleanup != nil {
556555
defer cleanup()
557556
}
558-
if prepErr == nil {
559-
args := append([]string{"--file", "image-references"}, regArgs...)
560-
args = append(args, payloadImage)
561-
out, err = oc.AsAdmin().Run("adm", "release", "extract").Args(args...).Output()
562-
} else {
563-
err = prepErr
557+
if err != nil {
558+
o.Expect(err).NotTo(o.HaveOccurred(), "PrepareImagePullSecretAndCABundle failed")
564559
}
560+
args := append([]string{"--file", "image-references"}, regArgs...)
561+
args = append(args, payloadImage)
562+
out, err := oc.AsAdmin().Run("adm", "release", "extract").Args(args...).Output()
565563
if err != nil {
566-
ctx := context.Background()
567-
isHyperShift, hsErr := exutil.IsHypershift(ctx, oc.AdminConfigClient())
568-
o.Expect(hsErr).NotTo(o.HaveOccurred())
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)")
572-
}
573-
o.Expect(err).NotTo(o.HaveOccurred(), "oc adm release extract failed where registry reachability appears healthy; details: %s", errorText)
564+
o.Expect(err).NotTo(o.HaveOccurred(), "oc adm release extract failed with error%s", err.Error())
574565
}
566+
575567
o.Expect(out).To(o.ContainSubstring(`"kind": "ImageStream"`))
576568
o.Expect(out).To(o.ContainSubstring(`"apiVersion": "image.openshift.io/v1"`))
577569
o.Expect(out).To(o.MatchRegexp(`"name": ".*"`), "Output should contain a valid name field")
@@ -660,32 +652,3 @@ func randomNode(oc *exutil.CLI) string {
660652
o.Expect(err).NotTo(o.HaveOccurred())
661653
return nodes.Items[rand.Intn(len(nodes.Items))].Name
662654
}
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)