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

gitrepo: Add support for specifying proxy per GitRepository #1109

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

aryan9600
Copy link
Member

@aryan9600 aryan9600 commented May 30, 2023

Add .spec.proxySecretRef.name to the GitRepository API to allow referencing a secret containing the proxy settings to be used for all remote Git operations for the particular GitRepository object. It takes precedence over any proxy configured through environment variables.

This allows for users to specify different proxy settings for different GitRepository objects as opposed to the current way of using env vars to specify proxy settings at a global controller level. This is particularly useful when the controller is running in a multi-tenant environment and tenants want to use their own proxy servers.

@aryan9600 aryan9600 added enhancement New feature or request area/git Git related issues and pull requests labels May 30, 2023
api/v1/gitrepository_types.go Outdated Show resolved Hide resolved
internal/controller/gitrepository_controller.go Outdated Show resolved Hide resolved
@aryan9600 aryan9600 force-pushed the gitrepo-proxy branch 5 times, most recently from 6515aaf to c74f6b1 Compare June 26, 2023 08:25
@aryan9600 aryan9600 requested review from darkowlzz and hiddeco June 26, 2023 08:38
docs/spec/v1/gitrepositories.md Outdated Show resolved Hide resolved
docs/spec/v1/gitrepositories.md Outdated Show resolved Hide resolved
docs/spec/v1/gitrepositories.md Outdated Show resolved Hide resolved
docs/spec/v1/gitrepositories.md Outdated Show resolved Hide resolved
internal/controller/gitrepository_controller_test.go Outdated Show resolved Hide resolved
internal/controller/gitrepository_controller_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

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

Left a few minor suggestions.
The overall implementation LGTM!

api/v1/gitrepository_types.go Show resolved Hide resolved
docs/spec/v1/gitrepositories.md Outdated Show resolved Hide resolved
docs/spec/v1/gitrepositories.md Outdated Show resolved Hide resolved
Add `.spec.proxySecretRef.name` to the `GitRepository` API to allow
referencing a secret containing the proxy settings to be used for all
remote Git operations for the particular `GitRepository` object.
It takes precedence over any proxy configured through enviornment
variables.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
@aryan9600 aryan9600 requested review from hiddeco and removed request for hiddeco July 24, 2023 15:26
```

Proxying can also be configured in the source-controller Deployment directly by
using the standard environment variables such as `HTTPS_PROXY`, `ALL_PROXY`, etc.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

The cheatsheet is going away, we'll have a dedicated page for Proxy settings under installation/configuration, see fluxcd/website#1560. For now let's leave it like this, after the docs refactoring we can link to it from here.

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 @aryan9600 🥇

@aryan9600 aryan9600 merged commit 9ff98d9 into main Jul 26, 2023
@aryan9600 aryan9600 deleted the gitrepo-proxy branch July 26, 2023 09:21
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 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants