fluxcd-flux2/pkg
SAY-5 f399c72898 fix(cli): preserve password-only secret in flux create source git
`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>
2026-04-21 17:46:51 -07:00
..
bootstrap Update toolkit components 2025-09-15 17:33:20 +01:00
log Add discard logger 2022-10-12 11:55:00 +02:00
manifestgen fix(cli): preserve password-only secret in flux create source git 2026-04-21 17:46:51 -07:00
plugin Make plugin types public 2026-04-14 00:46:29 +03:00
printers misc: simplify row append 2023-10-17 14:08:06 +02:00
status bootstrap: provide better error message on timeout 2023-12-08 19:00:01 +05:30
uninstall Remove ArtifactGenerators during uninstall 2025-09-23 14:41:50 +03:00