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

Add proxy port to CNP if needed #1531

Merged
merged 5 commits into from
Feb 14, 2024
Merged

Add proxy port to CNP if needed #1531

merged 5 commits into from
Feb 14, 2024

Conversation

marieroque
Copy link
Contributor

@marieroque marieroque commented Feb 14, 2024

towards https://github.com/giantswarm/giantswarm/issues/29873

Checklist

I have:

  • Described why this change is being introduced
  • Separated out refactoring/reformatting in a dedicated PR
  • Updated changelog in CHANGELOG.md

@marieroque marieroque requested a review from a team as a code owner February 14, 2024 15:35
}
proxyPort := proxyURL.Port()
if proxyPort == "" {
proxyPort = "80"
Copy link
Contributor

Choose a reason for hiding this comment

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

Well this is nasty but if it works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have a suggestion to avoid that ?

Copy link
Contributor

@QuentinBisson QuentinBisson Feb 14, 2024

Choose a reason for hiding this comment

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

Well, the think is if it is https, it should be 443 and not 80 but no the nasty part was more about the nested proxy things above btw

Copy link
Contributor

Choose a reason for hiding this comment

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

I probably would have used this https://pkg.go.dev/golang.org/x/net/http/httpproxy#FromEnvironment and only checked the HTTPProxy and HTTPSProxy instead of having 4 nested ifs but it's temporary code so :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code refactored, tell me ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice :)

Copy link
Contributor

@QuantumEnigmaa QuantumEnigmaa left a comment

Choose a reason for hiding this comment

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

I like nasty code :)

@marieroque
Copy link
Contributor Author

marieroque commented Feb 14, 2024

Need to be tested on

  • goat
  • CAPI MC
  • Vintage MC

Marie Roque added 2 commits February 14, 2024 17:10
@marieroque marieroque merged commit 21bd0f6 into master Feb 14, 2024
5 checks passed
@marieroque marieroque deleted the update-cnp-with-proxy branch February 14, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants