Skip to content

Commit

Permalink
fix: due to bugs in kubernetes clients, we need to use a fork
Browse files Browse the repository at this point in the history
  • Loading branch information
stefreak committed Nov 2, 2023
1 parent 3c5efbc commit b5f05be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@codenamize/codenamize": "^1.1.1",
"@hapi/joi": "git+https://github.com/garden-io/joi.git#master",
"@jsdevtools/readdir-enhanced": "^6.0.4",
"@kubernetes/client-node": "^1.0.0-rc3",
"@kubernetes/client-node": "github:davidgamero/javascript#c17ff3193dbd111b9e5b5db939647af70005381e",
"@opentelemetry/api": "^1.6.0",
"@opentelemetry/core": "^1.17.1",
"@opentelemetry/exporter-trace-otlp-http": "0.43.0",
Expand Down
4 changes: 3 additions & 1 deletion core/src/plugins/kubernetes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ function makeApiClient<T extends ApiType>(kubeConfig: KubeConfig, apiClientType:
pre: async (context) => {
// patch the patch bug... (https://github.com/kubernetes-client/javascript/issues/19)
if (context.getHttpMethod() === "PATCH") {
context.setHeaderParam("content-type", "application/merge-patch+json")
// this does not work because it lowercases the header param:
// context.setHeaderParam("Content-Type", "application/merge-patch+json")
context["headers"]["Content-Type"] = "application/merge-patch+json"
}

const agent = await createProxyAgent(context.getAgent())
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5f05be

Please sign in to comment.