Socket
Socket
Sign inDemoInstall

openshift-rest-client

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openshift-rest-client - npm Package Compare versions

Comparing version 4.1.0-alpha.0 to 4.1.0

26

CHANGELOG.md

@@ -5,2 +5,28 @@ # Changelog

## [4.1.0](https://github.com/nodeshift/openshift-rest-client/compare/v4.0.1...v4.1.0) (2020-05-22)
### Features
* Load from cluster spec ([#218](https://github.com/nodeshift/openshift-rest-client/issues/218)) ([52324a7](https://github.com/nodeshift/openshift-rest-client/commit/52324a7dcfc30062a6fb7f56862b4b770e228b77))
### Bug Fixes
* upgrade eslint-plugin-node from 11.0.0 to 11.1.0 ([#210](https://github.com/nodeshift/openshift-rest-client/issues/210)) ([308cf54](https://github.com/nodeshift/openshift-rest-client/commit/308cf54da06a14b64d81e1186cf93acc2049ca3f))
### [4.0.1](https://github.com/nodeshift/openshift-rest-client/compare/v4.0.0...v4.0.1) (2020-04-13)
### Bug Fixes
* pin the kubernetese-client version to 8.3.6 ([#208](https://github.com/nodeshift/openshift-rest-client/issues/208)) ([d9dfbcb](https://github.com/nodeshift/openshift-rest-client/commit/d9dfbcbe71d6c8348b675fa0e4ab4c242774d9bf))
* upgrade coveralls from 3.0.6 to 3.0.9 ([#200](https://github.com/nodeshift/openshift-rest-client/issues/200)) ([c4d0fcd](https://github.com/nodeshift/openshift-rest-client/commit/c4d0fcd07fc2d894b28f41493a5f4ce2c8247c79))
* upgrade documentation from 12.1.2 to 12.1.4 ([#202](https://github.com/nodeshift/openshift-rest-client/issues/202)) ([60e418e](https://github.com/nodeshift/openshift-rest-client/commit/60e418ed6ee6589de370324c024e6677d15614aa))
* upgrade eslint from 6.5.0 to 6.8.0 ([#199](https://github.com/nodeshift/openshift-rest-client/issues/199)) ([baebe7a](https://github.com/nodeshift/openshift-rest-client/commit/baebe7ae49c87982b5af7115e34af3d80aea8596))
* upgrade kubernetes-client from 8.3.4 to 8.3.6 ([#203](https://github.com/nodeshift/openshift-rest-client/issues/203)) ([2dfa271](https://github.com/nodeshift/openshift-rest-client/commit/2dfa27148b3fed680f5458567c3670c9f96c511f))
* upgrade nock from 12.0.0 to 12.0.2 ([#201](https://github.com/nodeshift/openshift-rest-client/issues/201)) ([7597d6f](https://github.com/nodeshift/openshift-rest-client/commit/7597d6fb5142a798c4436e8021c88b858236fb57))
* upgrade request from 2.88.0 to 2.88.2 ([#204](https://github.com/nodeshift/openshift-rest-client/issues/204)) ([007a6b4](https://github.com/nodeshift/openshift-rest-client/commit/007a6b488f0d21f61f839ddf654fe61b5aae4a1a))
* upgrade tape from 4.13.0 to 4.13.2 ([#205](https://github.com/nodeshift/openshift-rest-client/issues/205)) ([5ab6a48](https://github.com/nodeshift/openshift-rest-client/commit/5ab6a4882f66f9aefb4df544d1bd7c7003835d10))
## [4.0.0](https://github.com/nodeshift/openshift-rest-client/compare/v3.2.0...v4.0.0) (2020-02-17)

@@ -7,0 +33,0 @@

22

lib/openshift-rest-client.js

@@ -64,2 +64,3 @@ 'use strict';

* @param {object} [settings] - settings object for the openshiftClient function
* @param {boolean} [settings.loadSpecFromCluster] - load the api spec from a remote cluster. Defaults to false
* @param {object|string} [settings.config] - custom config object. String value will assume a config file location

@@ -76,3 +77,9 @@ * @param {string} [settings.config.url] - Openshift cluster url

let config = settings.config;
const clientConfig = { backend: null, spec, getNames };
const clientConfig = { backend: null, /* spec, */ getNames };
if (!settings.loadSpecFromCluster) {
clientConfig.spec = spec;
}
const kubeconfig = new KubeConfig();

@@ -148,3 +155,14 @@

const client = new Client(clientConfig);
let client = new Client(clientConfig);
if (settings.loadSpecFromCluster) {
try {
await client.loadSpec();
} catch (err) {
// Warn the user there was an error and loading the other spec
console.warn('Warning: Remote client spec unable to load', err.message);
console.warn('Warning: Loading default spec instead');
clientConfig.spec = spec;
client = new Client(clientConfig);
}
}

@@ -151,0 +169,0 @@ // CRD with the service instance stuff, but only to this client, not the cluster

8

package.json
{
"name": "openshift-rest-client",
"version": "4.1.0-alpha.0",
"version": "4.1.0",
"description": "Node.js client for developing with OpenShift",

@@ -54,3 +54,3 @@ "main": "index.js",

"devDependencies": {
"coveralls": "~3.0.9",
"coveralls": "~3.1.0",
"documentation": "^12.1.4",

@@ -61,3 +61,3 @@ "eslint": "^6.8.0",

"eslint-plugin-import": "~2.20.1",
"eslint-plugin-node": "~11.0.0",
"eslint-plugin-node": "~11.1.0",
"eslint-plugin-promise": "~4.2.1",

@@ -68,3 +68,3 @@ "eslint-plugin-standard": "^4.0.0",

"proxyquire": "^2.1.3",
"standard-version": "^7.1.0",
"standard-version": "^8.0.0",
"tap-spec": "^5.0.0",

@@ -71,0 +71,0 @@ "tape": "~4.13.2"

@@ -116,4 +116,14 @@ [![Build Status](https://travis-ci.org/nodeshift/openshift-rest-client.svg?branch=master)](https://travis-ci.org/nodeshift/openshift-rest-client) [![Coverage Status](https://coveralls.io/repos/github/nodeshift/openshift-rest-client/badge.svg?branch=master)](https://coveralls.io/github/nodeshift/openshift-rest-client?branch=master)

#### Load API from a Remote Cluster
By default, the openshift-rest-client, will load a swagger spec file that is included with the module. This has all the basic API's that come with Openshift and Kubernetes. If you are using operators to extend your cluster, the openshift-rest-client, by default, won't know about them.
To fix this, you can tell the openshift-rest-client to load the spec file from your remote cluster using the `loadSpecFromCluster` option. Setting this to true, will try to load the spec file from your clusters `/openapi/v2` endpoint. If that doesn't exist, it will also try, `/swagger.json`
If the remote spec cannot be loaded, a warning will be output to the console and the default spec will be loaded.
In a future version of this client, this might become the default.
#### Changes in 2.0

@@ -120,0 +130,0 @@

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