Skip to content

Commit

Permalink
e2e: do not use crc-admin context to log in
Browse files Browse the repository at this point in the history
Getting error: no context exists with the name: "crc-admin",
e.g. https://crcqe-asia.s3.ap-south-1.amazonaws.com/release/2.11.0/RHEL-8.6/qe-results/e2e-non-ux.xml
  • Loading branch information
jsliacan authored and openshift-merge-robot committed Jan 19, 2023
1 parent 64f564f commit a8efd07
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,16 @@ func ConfigFileInCRCHomeContainsKey(format string, configFile string, condition
}

func LoginToOcClusterSucceedsOrFails(expected string) error {
cmd := "oc config use-context crc-admin"
return util.ExecuteCommandSucceedsOrFails(cmd, expected)

credentialsCommand := "crc console --credentials" //#nosec G101
err := util.ExecuteCommand(credentialsCommand)
if err != nil {
return err
}
out := util.GetLastCommandOutput("stdout")
ocLoginAsAdminCommand := strings.Split(out, "'")[3]

return util.ExecuteCommandSucceedsOrFails(ocLoginAsAdminCommand, expected)
}

func SetKubeConfigContextSucceedsOrFails(context, expected string) error {
Expand Down

0 comments on commit a8efd07

Please sign in to comment.