Checking that all secrets are created before running tests

This commit is contained in:
Volodymyr Zotov
2025-08-21 10:17:19 -05:00
parent d0b11c70f0
commit 7187f41ef1
2 changed files with 32 additions and 9 deletions

View File

@@ -48,6 +48,17 @@ func DeleteSecret(name string) {
Expect(err).NotTo(HaveOccurred())
}
func CheckSecretExists(name string) {
output, err := system.Run("kubectl", "get", "secret", name, "-o", "jsonpath={.metadata.name}")
Expect(err).NotTo(HaveOccurred())
Expect(output).To(Equal(name))
}
func Apply(yamlPath string) {
_, err := system.Run("kubectl", "apply", "-f", yamlPath)
Expect(err).NotTo(HaveOccurred())
}
func SetContextNamespace(namespace string) {
By("Set namespace to " + namespace)
_, err := system.Run("kubectl", "config", "set-context", "--current", "--namespace="+namespace)