Skip to content

Commit

Permalink
fix(client-node): fixes to @kubernetes/client-node backend (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
Silas Boyd-Wickizer committed Jun 13, 2019
1 parent 6c5287c commit 66e0328
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
9 changes: 3 additions & 6 deletions backends/kubernetes-client-node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const pascalcase = require('pascalcase')
const camelCase = require('camelcase')
const { PassThrough, Readable } = require('stream')

//
Expand All @@ -14,10 +14,7 @@ class ClientNodeBackend {
}

_getApiClient (tag) {
//
// API type is a snake_case CamelCase amalgamation. E.g., Core_v1Api
//
const apiType = tag.charAt(0).toUpperCase() + tag.slice(1) + 'Api'
const apiType = camelCase(tag, { pascalCase: true }) + 'Api'
if (!(apiType in this.apiClients)) {
this.apiClients[apiType] = this.kubeconfig.makeApiClient(this.client[apiType])
}
Expand Down Expand Up @@ -91,7 +88,7 @@ class ClientNodeBackend {
// Support older versions of the Swagger specifications by removing the tag
// part.
//
const method = operationObject.operationId.replace(pascalcase(tag), '')
const method = operationObject.operationId.replace(camelCase(tag, { pascalCase: true }), '')

//
// @kubernetes/client-node methods take parameters in the order the OpenAPI
Expand Down
20 changes: 11 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"typings"
],
"dependencies": {
"@kubernetes/client-node": "^0.10.0",
"@kubernetes/client-node": "0.10.0",
"camelcase": "^5.3.1",
"deepmerge": "^3.2.0",
"depd": "^2.0.0",
"js-yaml": "^3.13.1",
"json-stream": "^1.0.0",
"openid-client": "^3.1.0",
"pascalcase": "^0.1.1",
"pump": "^3.0.0",
"qs": "^6.7.0",
"request": "^2.88.0",
Expand Down

0 comments on commit 66e0328

Please sign in to comment.