Skip to content

Commit

Permalink
fix: secrets update (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsukhin authored Mar 7, 2024
1 parent d195552 commit 059fddf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/client/testsuites/v3/testsuites.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ func (s TestSuitesClient) CreateTestsuiteSecrets(testsuite *testsuitev3.TestSuit
StringData: map[string]string{},
}

for key, value := range testsuite.Labels {
secret.Labels[key] = value
}

if err := testsuiteVarsToSecret(testsuite, secret); err != nil {
return err
}
Expand Down Expand Up @@ -247,11 +251,15 @@ func (s TestSuitesClient) UpdateTestsuiteSecrets(testsuite *testsuitev3.TestSuit
secret.Type = corev1.SecretTypeOpaque
}

for key, value := range testsuite.Labels {
secret.Labels[key] = value
}

if err = testsuiteVarsToSecret(testsuite, secret); err != nil {
return err
}

if secretExists && len(secret.StringData) > 0 {
if len(secret.StringData) > 0 {
if !secretExists {
err = s.Client.Create(context.Background(), secret)
} else {
Expand Down

0 comments on commit 059fddf

Please sign in to comment.