Skip to content

Commit

Permalink
OCM-10299 | ci: fix rosa-hcp-external-auth deploy failure
Browse files Browse the repository at this point in the history
  • Loading branch information
yingzhanredhat committed Aug 16, 2024
1 parent c52185f commit caa74ed
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions tests/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package e2e

import (
"fmt"
"path"
"time"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -42,17 +43,23 @@ var _ = Describe("Cluster preparation", labels.Feature.Cluster, func() {
breakGlassCredList, err := client.BreakGlassCredential.ListBreakGlassCredentialsAndReflect(clusterID)
Expect(err).To(BeNil())
testDir := config.Test.OutputDir
kubeconfigFile := fmt.Sprintf("%s/%s.kubeconfig", testDir, clusterID)
kubeconfigFile := path.Join("%s/%s.kubeconfig", testDir, clusterID)

By("Get the issued credential")
for _, i := range breakGlassCredList.BreakGlassCredentials {
if i.Status == "issued" {
output, err := client.BreakGlassCredential.GetIssuedCredential(clusterID, i.ID)
Expect(err).ToNot(HaveOccurred())
_, err = common.CreateFileWithContent(kubeconfigFile, output.String())
Expect(err).ToNot(HaveOccurred())
break
}
Eventually(
client.BreakGlassCredential.WaitForBreakGlassCredentialToStatus(
clusterID,
"issued",
i.Username),
time.Minute*1,
).Should(BeTrue())
output, err := client.BreakGlassCredential.GetIssuedCredential(clusterID, i.ID)
Expect(err).ToNot(HaveOccurred())
Expect(output.String()).ToNot(BeEmpty())
_, err = common.CreateFileWithContent(kubeconfigFile, output.String())
Expect(err).ToNot(HaveOccurred())
break
}
hostPrefix, podCIDR := "", ""
for _, networkLine := range clusterDetails.Network {
Expand Down

0 comments on commit caa74ed

Please sign in to comment.