Skip to content

Fix bug for K8s API servers behind proxy#224

Open
goyalankit wants to merge 2 commits intodatabricks:masterfrom
goyalankit:master
Open

Fix bug for K8s API servers behind proxy#224
goyalankit wants to merge 2 commits intodatabricks:masterfrom
goyalankit:master

Conversation

@goyalankit
Copy link

@goyalankit goyalankit commented Jan 3, 2024

We have multiple Kubernetes servers behind a proxy and the current logic removes the URL prefix which causes a Bad Request.

For example:
According to the current logic:

self.endpoint = "https://hostname/cluster-1"
parts.uri = "/api/v1/namespaces/default/pods"
// strips the cluster-1 prefix
self.endpoint.join(&parts.uri.to_string())?; // https://hostname/api/v1/namespaces/default/pods

Error:

[cluster-1] [default] [none] > pods
Parse Error: Got unexpected status 400 Bad Request (Other(Err(Error("expected value", line: 1, column: 1))), 0)

The commit fixes the above situation by preserving the prefix url

@MortezaRamezani
Copy link

I think this line needs the change as well:

let url = self.endpoint.join(&parts.uri.to_string())?;

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.

2 participants