Remove secret from previous step

This commit is contained in:
Volodymyr Zotov
2025-08-20 10:28:18 -05:00
parent 91a9bb6d63
commit e167db2357
4 changed files with 27 additions and 12 deletions

View File

@@ -40,8 +40,8 @@ func CreateOpCredentialsSecret() {
CreateSecretFromFile("op-session", "op-credentials")
}
func Delete(kind, name string) {
_, err := cmd.Run("kubectl", "delete", kind, name, "--ignore-not-found=true")
func DeleteSecret(name string) {
_, err := cmd.Run("kubectl", "delete", "secret", name, "--ignore-not-found=true")
Expect(err).NotTo(HaveOccurred())
}

View File

@@ -7,7 +7,6 @@ import (
. "github.com/onsi/gomega"
"github.com/1Password/onepassword-operator/test/cmd"
"github.com/1Password/onepassword-operator/test/testhelper/kube"
)
func BuildOperatorImage() {
@@ -34,12 +33,3 @@ func DeployOperator() {
g.Expect(output).To(ContainSubstring("Running"))
}, 30*time.Second, 1*time.Second).Should(Succeed())
}
func UndeployOperator() {
kube.Delete("secret", "onepassword-connect-token")
kube.Delete("secret", "onepassword-service-account-token")
By("undeploying the operator")
_, err := cmd.Run("make", "undeploy", "ignore-not-found")
Expect(err).NotTo(HaveOccurred())
}