auto-kubernetes-client
Advanced tools
Comparing version 0.5.1 to 0.6.1
{ | ||
"name": "auto-kubernetes-client", | ||
"version": "0.5.1", | ||
"version": "0.6.1", | ||
"description": "NodeJS Kubernetes Client with automatic API discovery", | ||
@@ -26,3 +26,3 @@ "main": "src/index.js", | ||
"devDependencies": { | ||
"eslint": "^4.0.0", | ||
"eslint": "^5.0.0", | ||
"eslint-config-collaborne": "^1.1.1" | ||
@@ -32,3 +32,3 @@ }, | ||
"check-node-version": "^3.0.0", | ||
"deepmerge": "^2.0.0", | ||
"deepmerge": "^3.0.0", | ||
"flatmap": "0.0.3", | ||
@@ -35,0 +35,0 @@ "request": "^2.81.0", |
@@ -17,2 +17,3 @@ const request = require('request'); | ||
* @property {string} [key] | ||
* @property {string} [token] | ||
* @property {ConfigurationAuth} [auth] | ||
@@ -42,6 +43,15 @@ */ | ||
function connect(config) { | ||
const {token, ...otherConfig} = config; | ||
let authConfig = {}; | ||
if (token) { | ||
authConfig = { | ||
auth: { | ||
bearer: token, | ||
}, | ||
}; | ||
} | ||
// Ensure that the config.url ends with a '/' | ||
const configOptions = Object.assign({}, config, { | ||
url: config.url.endsWith('/') ? config.url : `${config.url}/` | ||
}); | ||
const configOptions = Object.assign({}, otherConfig, { | ||
url: config.url.endsWith('/') ? config.url : `${config.url}/`, | ||
}, authConfig); | ||
@@ -266,2 +276,5 @@ /** | ||
* | ||
* Note that not all resources support all patch content types, and an error 415 with a reason "UnsupportedMediaType" may get returned | ||
* in that case. | ||
* | ||
* @param {any} object the patch to apply | ||
@@ -268,0 +281,0 @@ * @param {String} [contentType] the content type |
Sorry, the diff of this file is not supported yet
33561
450
+ Addeddeepmerge@3.3.0(transitive)
- Removeddeepmerge@2.2.1(transitive)
Updateddeepmerge@^3.0.0