Skip to content

Commit a8efd07

Browse files
Jakub Sliacanopenshift-merge-robot
authored andcommitted
e2e: do not use crc-admin context to log in
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
1 parent 64f564f commit a8efd07

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/e2e/testsuite/testsuite.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,16 @@ func ConfigFileInCRCHomeContainsKey(format string, configFile string, condition
531531
}
532532

533533
func LoginToOcClusterSucceedsOrFails(expected string) error {
534-
cmd := "oc config use-context crc-admin"
535-
return util.ExecuteCommandSucceedsOrFails(cmd, expected)
534+
535+
credentialsCommand := "crc console --credentials" //#nosec G101
536+
err := util.ExecuteCommand(credentialsCommand)
537+
if err != nil {
538+
return err
539+
}
540+
out := util.GetLastCommandOutput("stdout")
541+
ocLoginAsAdminCommand := strings.Split(out, "'")[3]
542+
543+
return util.ExecuteCommandSucceedsOrFails(ocLoginAsAdminCommand, expected)
536544
}
537545

538546
func SetKubeConfigContextSucceedsOrFails(context, expected string) error {

0 commit comments

Comments
 (0)