From c6bf49a21f9595f0978d2afdf02aebe32d206d7e Mon Sep 17 00:00:00 2001 From: Craig O'Donnell Date: Mon, 2 Oct 2023 17:04:04 -0400 Subject: [PATCH] ensure secret after kots is installed --- e2e/e2e_test.go | 1 - e2e/kots/kots.go | 14 ++++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 05783441c4..ac839727ea 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -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) } diff --git a/e2e/kots/kots.go b/e2e/kots/kots.go index 62f93c2bb4..8474fe72d6 100644 --- a/e2e/kots/kots.go +++ b/e2e/kots/kots.go @@ -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) }