Skip to content

Commit

Permalink
use backup oc package
Browse files Browse the repository at this point in the history
  • Loading branch information
xueqzhan committed May 2, 2024
1 parent d029261 commit f18ba21
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/monitortests/network/disruptionpodnetwork/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"

configclient "github.com/openshift/client-go/config/clientset/versioned"
exutil "github.com/openshift/origin/test/extended/util"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"
Expand Down Expand Up @@ -38,8 +39,14 @@ func GetOpenshiftTestsImagePullSpec(ctx context.Context, adminRESTConfig *rest.C
cmd.Stdout = out
cmd.Stderr = errOut
if err := cmd.Run(); err != nil {
return "", fmt.Errorf("unable to determine openshift-tests image: %v: %v", err, errOut.String())
var oc = exutil.NewCLI("default").AsAdmin()
out, err := oc.WithoutNamespace().Run("adm").Args("release", "info", suggestedPayloadImage, "--image-for=tests").Output()
if err != nil {
return "", fmt.Errorf("still unable to determine openshift-tests image: %v: %v", err, errOut.String())
}
fmt.Printf("-----admin release info is %v\n", out)
}

openshiftTestsImagePullSpec := strings.TrimSpace(out.String())
fmt.Printf("openshift-tests image pull spec is %v\n", openshiftTestsImagePullSpec)

Expand Down

0 comments on commit f18ba21

Please sign in to comment.