Skip to content

Commit

Permalink
ensure secret after kots is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Oct 2, 2023
1 parent b60a068 commit c6bf49a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ var _ = Describe("E2E", func() {
adminConsolePort = kotsInstaller.AdminConsolePortForward(c.GetKubeconfig(), test, kotsadmForwardPort)
} else {
GinkgoWriter.Println("Installing KOTS")
kotsInstaller.EnsureSecret(c.GetKubeconfig(), test)
adminConsolePort = kotsInstaller.Install(c.GetKubeconfig(), test, kotsadmForwardPort)
}

Expand Down
14 changes: 4 additions & 10 deletions e2e/kots/kots.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,15 @@ func NewInstaller(imageRegistry, imageNamespace, imageTag string, airgap bool, d
}
}

func (i *Installer) EnsureSecret(kubeconfig string, test inventory.Test) {
if i.dockerhubUsername == "" || i.dockerhubPassword == "" {
fmt.Println("Skipping dockerhub ensure-secret because no credentials were provided")
return
}
session, err := i.ensureSecret(kubeconfig, test)
Expect(err).WithOffset(1).Should(Succeed(), "Kots docker ensure-secret failed")
Eventually(session).WithOffset(1).WithTimeout(InstallWaitDuration).Should(gexec.Exit(0), "Kots docker ensure-secret failed with non-zero exit code")
}

func (i *Installer) Install(kubeconfig string, test inventory.Test, adminConsolePort string) string {
session, err := i.install(kubeconfig, test)
Expect(err).WithOffset(1).Should(Succeed(), "Kots install failed")
Eventually(session).WithOffset(1).WithTimeout(InstallWaitDuration).Should(gexec.Exit(0), "Kots install failed with non-zero exit code")

session, err = i.ensureSecret(kubeconfig, test)
Expect(err).WithOffset(1).Should(Succeed(), "Kots docker ensure-secret failed")
Eventually(session).WithOffset(1).WithTimeout(InstallWaitDuration).Should(gexec.Exit(0), "Kots docker ensure-secret failed with non-zero exit code")

return i.AdminConsolePortForward(kubeconfig, test, adminConsolePort)
}

Expand Down

0 comments on commit c6bf49a

Please sign in to comment.