Skip to content

Commit e55e9d7

Browse files
wangyeleiapecloud-bot
authored andcommitted
chore: support empty password when system account refers the custom secret (#9911)
(cherry picked from commit 6ea98ed)
1 parent a1d95ae commit e55e9d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/apps/component/transformer_component_account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (t *componentAccountTransformer) getPasswordFromSecret(ctx graph.TransformC
199199
if len(account.SecretRef.Password) > 0 {
200200
passwordKey = account.SecretRef.Password
201201
}
202-
if len(secret.Data) == 0 || len(secret.Data[passwordKey]) == 0 {
202+
if _, ok := secret.Data[passwordKey]; !ok {
203203
return nil, fmt.Errorf("referenced account secret has no required credential field: %s", passwordKey)
204204
}
205205
return secret.Data[passwordKey], nil

0 commit comments

Comments
 (0)