Skip to content

Commit

Permalink
Merge pull request #399 from stuggi/fix_secret_th
Browse files Browse the repository at this point in the history
[helpers] fix UpdateSecret for empty data in secret
  • Loading branch information
stuggi authored Nov 21, 2023
2 parents d351509 + f8c3914 commit f84876c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/common/test/helpers/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ func (tc *TestHelper) AssertSecretDoesNotExist(name types.NamespacedName) {
func (tc *TestHelper) UpdateSecret(secretName types.NamespacedName, key string, newValue []byte) {
gomega.Eventually(func(g gomega.Gomega) {
secret := tc.GetSecret(secretName)
if secret.Data == nil {
secret.Data = map[string][]byte{}
}
secret.Data[key] = newValue
g.Expect(tc.K8sClient.Update(tc.Ctx, &secret)).Should(gomega.Succeed())
}, tc.Timeout, tc.Interval).Should(gomega.Succeed())
Expand Down

0 comments on commit f84876c

Please sign in to comment.