1
0
mirror of synced 2026-02-12 20:56:56 +00:00

Make username optional for create secret git

Git authentication with basic auth doesn't necessarily require a
username to be present.

Signed-off-by: talife <gilletvincent@gmail.com>
Signed-off-by: Max Jonas Werner <mail@makk.es>
This commit is contained in:
Vincent Gillet
2023-07-31 21:35:10 +08:00
committed by Max Jonas Werner
parent 525bd21cd1
commit a6cb5930f8
4 changed files with 20 additions and 4 deletions

View File

@@ -148,8 +148,10 @@ func buildSecret(keypair *ssh.KeyPair, hostKey, dockerCfg []byte, options Option
return
}
if options.Username != "" && options.Password != "" {
secret.StringData[UsernameSecretKey] = options.Username
if options.Password != "" {
if options.Username != "" {
secret.StringData[UsernameSecretKey] = options.Username
}
secret.StringData[PasswordSecretKey] = options.Password
}
if options.BearerToken != "" {