Skip to content

Conversation

@veith4f
Copy link

@veith4f veith4f commented Aug 27, 2025

Description of your changes

Clusters in kubeconfig may have a field proxy-url that needs to be respected to reach the specified endpoints.
Currently, client.go in the provider does not respect this.

struct rest.Config created in client.go offers a field proxy:func(*http.Request) (*url.URL, error) that may be used to this end.

How has this code been tested

Just compile/deploy-local as of now. Want to see if there is interest.

Signed-off-by: Fabian Schütz <fabian.f.schuetz@mercedes-benz.com>
@veith4f
Copy link
Author

veith4f commented Aug 27, 2025

Was now successfully deployed, packaged, installed and tested in our environment.

Kubernetes Object was correctly provisioned.

@mcfarlanem
Copy link

Compiled, packaged, deployed, installed, and tested provider-kubernetes and provider-helm based on this branch. Everything works as expected with proxy-url in private EKS cluster and without proxy-url in public EKS cluster.

Thanks @veith4f for this work. Can we get this contribution merged?

See #347.

// See https://pkg.go.dev/k8s.io/client-go/rest#Config
if cluster.ProxyURL != "" {
return func(*http.Request) (*url.URL, error) {
return url.Parse(cluster.ProxyURL)
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be good to add explicit error handling for the url.Parse() call to catch invalid proxy URLs.

Suggested change
return url.Parse(cluster.ProxyURL)
parsedURL, err := url.Parse(cluster.ProxyURL)
if err != nil {
return nil, err
}
return parsedURL, nil

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