mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-23 18:05:54 +00:00
`sourcesecret.buildGitSecret` previously wrote the Username and Password secret fields only when *both* were set. With the Azure DevOps PAT flow, `flux create source git --password=<pat>` has no username (the token is the credential), so both fields were silently dropped and the resulting secret was empty, breaking authentication. Write the two fields independently, so: - `--username` + `--password` -> username + password keys (unchanged); - `--password` alone -> password key only (fixes #3892); - `--username` alone -> username key only. The SSH-passphrase case also becomes simpler: the duplicated `if options.Password != ""` inside the keypair branch collapses into the top-level write. Adds a `buildGitSecret` unit test covering all four credential shapes, including the Azure DevOps PAT scenario. Closes #3892. Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| bootstrap | ||
| log | ||
| manifestgen | ||
| plugin | ||
| printers | ||
| status | ||
| uninstall | ||