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

Maintain original scheme when using --token-auth #3117

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

carlosonunez-vmw
Copy link
Contributor

@carlosonunez-vmw carlosonunez-vmw commented Sep 16, 2022

Fixes #3116.

If you're using an HTTP-based Git server with Flux, you need to provide --token-auth to avoid triggering an SSH host key check (see #2825). Unfortunately, doing this forces the URL in the GitRepository resource created during bootstrapping to always use https. This will cause Kustomization reconcile errors for servers that do not have HTTPS enabled or do not have the appropriate certs installed or available.

This pull request fixes this by keeping the repository URL scheme intact when using --token-auth.

Signed-off-by: Carlos Nunez 75340335+carlosonunez-vmw@users.noreply.github.com

@stefanprodan stefanprodan added bug Something isn't working area/bootstrap Bootstrap related issues and pull requests labels Sep 19, 2022
cmd/flux/bootstrap_git.go Outdated Show resolved Hide resolved
@carlosonunez-vmw
Copy link
Contributor Author

Thanks, @hiddeco! Good suggestion.

@stefanprodan
Copy link
Member

@carlosonunez-vmw please squash the two commits

@carlosonunez-vmw carlosonunez-vmw force-pushed the main branch 2 times, most recently from 34bf153 to fcb09a2 Compare September 28, 2022 03:10
If you're using an HTTP-based Git server with Flux, you need to provide `--token-auth` to avoid triggering an SSH host key check (see [here](fluxcd#2825 (comment))). Unfortunately, doing this forces the URL in the `GitRepository` resource created during bootstrapping to always use `https`. This will cause Kustomization reconcile errors for servers that do not have HTTPS enabled or do not have the appropriate certs installed or available.

This pull request fixes this by keeping the repository URL scheme intact when using `--token-auth`.

Signed-off-by: Carlos Nunez <75340335+carlosonunez-vmw@users.noreply.github.com>
@carlosonunez-vmw
Copy link
Contributor Author

done; @stefanprodan PTAL

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @carlosonunez-vmw 🥇

@stefanprodan stefanprodan merged commit 04de520 into fluxcd:main Sep 28, 2022
@carlosonunez-vmw
Copy link
Contributor Author

carlosonunez-vmw commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bootstrap Bootstrap related issues and pull requests bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--allow-insecure-http forces HTTPS in corresponding GitRepository
3 participants