Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auto-kubernetes-client

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-kubernetes-client - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

2

package.json
{
"name": "auto-kubernetes-client",
"version": "0.4.2",
"version": "0.4.3",
"description": "NodeJS Kubernetes Client with automatic API discoveryEdit",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -77,5 +77,26 @@ 'use strict';

} else {
if (cooked && data.kind === 'Status' && data.status === 'Failure') {
// Synthesize an error from the status
return reject(Object.assign(data, new Error(data.message)));
if (cooked) {
let maybeStatus;
if (typeof data === 'string') {
// The server doesn't (always?) produce a Status for 401/403 errors it seems.
// It should according to https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#http-status-codes,
// but likely the authentication/authorization layer prevents that.
// See https://github.com/kubernetes/kubernetes/issues/45970
maybeStatus = {
kind: 'Status',
apiVersion: 'v1',
metadata: {},
status: 'Failure',
message: data,
reason: response.statusMessage,
code: response.statusCode,
};
} else {
maybeStatus = data;
}
if (maybeStatus.kind === 'Status' && maybeStatus.status === 'Failure') {
// Synthesize an error from the status
return reject(Object.assign(maybeStatus, new Error(maybeStatus.message)));
}
}

@@ -82,0 +103,0 @@ return resolve(data);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc