-
Notifications
You must be signed in to change notification settings - Fork 981
Proxy Support for Custom HTTP Source CRD Download Strategy in Karmada Operator #6577
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @jabellard, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces a new feature to the Karmada Operator, allowing users to specify an HTTP/HTTPS proxy for downloading Custom Resource Definition (CRD) tarballs from an HTTP source. This enhances network flexibility for environments requiring proxy configurations to access external resources, directly addressing the need outlined in the linked proposal and issue.
Highlights
- API Extension: A new
proxy
field has been added to theHTTPSource
specification within theKarmada
CRD (operator.karmada.io_karmadas.yaml
). This field allows users to define an HTTP/HTTPS proxy URL for CRD downloads. - Core Download Logic Update: The
DownloadFile
utility function (operator/pkg/util/util.go
) has been updated to accept an optional proxy URL. It now dynamically configures the HTTP client to route download requests through the specified proxy if provided. - Input Validation: New validation logic has been added (
operator/pkg/controller/karmada/validating.go
) to ensure that any provided proxy URL is a valid format, preventing misconfigurations. - Type Definition and DeepCopy: The
HTTPSource
Go struct (operator/pkg/apis/operator/v1alpha1/type.go
) has been extended with the newProxy
field, and the auto-generated deepcopy methods (operator/pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go
) have been updated accordingly to handle this new optional pointer field.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces proxy support for downloading CRD tarballs from a custom HTTP source. The changes include updating the CRD definition, the Go types, and the download logic to handle an optional proxy URL.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6577 +/- ##
=======================================
Coverage 45.35% 45.35%
=======================================
Files 687 687
Lines 56384 56425 +41
=======================================
+ Hits 25572 25593 +21
- Misses 29217 29231 +14
- Partials 1595 1601 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks~
others LGTM
Thanks, @jabellard, I have no further comments. Given that I don't have the conditions to do local verification, have you verified the related functionality? BTW, just curious, why does my browser redirect to https://www.linkedin.com/ when I enter http://www.proxy.com? |
That's weird. I guess we can change that value. I put that there as a dummy placeholder value. For E2E testing, I ran some tests using some internal cooperate proxies that enable cross-network segment traffic within our environment. |
Yes, it's indeed weird, and sometimes the URLs that open are not consistent. If possible, I suggest changing to a different URL. Others LGTM |
@zhzhuang-zju, thanks for reviewing. I Just pushed an update to address. Please let me know if you have any other comments. I need this feature to setup our Karmada managed service in a new network segment, and I'm hoping to have it available as part of the next alpha release. Thanks for reviewing. |
/lgtm
Thanks for the context! According to the Karmada release cycle, we expect to release the first beta version of v1.15 in the next few days, and we will include your new feature in this release. |
cc @RainbowMango for another look |
Hi Joe, the next release (v1.15.0-beta.0) will be cut today(a little bit challenging). The next release after this one is v1.15.0-rc.0, scheduled for August 15th. Please let me know which release you expect. |
Would be great if we can get it as part of this release. This PR is ready to go and I've already validated it working. |
Will try my best to make it happen. |
@jabellard I'm sorry for missing the v1.15.0-beta.0 release, as I have a comment regarding the API change that must be confirmed from you. Sorry for the delay, I'm in a closed meeting this week have limited bandwidth on this. Please let me know if the next release(Aug 15th) meets your schedule. |
Thanks for helping to get it in the release. We can aim to complete this for the next one. For now, I can try some workarounds to solve my cross-network traffic problem. Will follow up on comments within next few days. |
OK. Sorry for the delay, I was in a offline meeting last week(and also this week :(). I think we can work on the proposal first, there I proposing the API change. |
Hey @RainbowMango . I pushed changes to address your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assign
Adding to my queue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me, thanks.
@zhzhuang-zju You might like to take another look?
Thanks~ I have no further comments |
Signed-off-by: Joe Nathan Abellard <[email protected]>
@RainbowMango @zhzhuang-zju thanks for reviewing and providing great constructive feedback. I just pushed changes to address comments and then squashed. |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Implementation of this proposal.
Which issue(s) this PR fixes:
Part of #6573
Special notes for your reviewer:
Does this PR introduce a user-facing change?: