Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make username optional for flux create secret git #4119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

talife
Copy link
Contributor

@talife talife commented Aug 1, 2023

Fix: #3892

test added with a golden file to create a secret with only a password key.

@makkes makkes force-pushed the git-source-token branch 2 times, most recently from 0e19256 to 6db6197 Compare August 23, 2023 09:58
Git authentication with basic auth doesn't necessarily require a
username to be present.

Signed-off-by: talife <[email protected]>
Signed-off-by: Max Jonas Werner <[email protected]>
@stefanprodan stefanprodan changed the title removing username being mandatory with password in source secret with… Make username optional for flux create secret git Aug 23, 2023
@stefanprodan stefanprodan added the area/git Git related issues and pull requests label Aug 23, 2023
@hiddeco
Copy link
Member

hiddeco commented Aug 23, 2023

This should not work, as we validate a HTTP/S URL to contain a username in the underlying Git library: https://github.com/fluxcd/pkg/blob/12b79e9629e18524dc0d10b71f9df252784c5fa9/git/options.go#L62-L65

Given you highlight in the issue that manually constructing the Secret works as expected, I am wondering if you are trying to create the Secret for an SSH URL without having ssh:// specified.

@stefanprodan stefanprodan added the hold Issues and pull requests put on hold label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/git Git related issues and pull requests hold Issues and pull requests put on hold
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flux create source git with --password fails to create secret
3 participants