Skip to content

Commit

Permalink
feat: add the service instance endpoint (#125)
Browse files Browse the repository at this point in the history
fixes #121
  • Loading branch information
lholmquist authored Apr 24, 2019
1 parent c790959 commit d0d9374
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/openshift-rest-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const path = require('path');
const { Client, config, alias } = require('kubernetes-client');
const { getTokenFromBasicAuth } = require('./basic-auth-request');

const serviceCatalogCRD = require('./specs/service-catalog-crd.json');

// A list of shorthand aliases
const resourceAliases = {
'apps.openshift.io': ['app'],
Expand Down Expand Up @@ -85,6 +87,9 @@ async function openshiftClient (settings = {}) {

// TODO: need to be able to pass in the config object here
const client = new Client({ config: kubeconfig || config.fromKubeconfig(), spec, getNames: getNames });

// CRD with the service instance stuff, but only to this client, not the cluster
client.addCustomResourceDefinition(serviceCatalogCRD);
return client;
}

Expand Down
17 changes: 17 additions & 0 deletions lib/specs/service-catalog-crd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"kind": "CustomResourceDefinition",
"spec": {
"scope": "Namespaced",
"version": "v1beta1",
"group": "servicecatalog.k8s.io",
"names": {
"shortNames": [
"si"
],
"kind": "ServiceInstance",
"plural": "serviceinstances",
"singular": "serviceinstance"
}
},
"apiVersion": "servicecatalog.k8s.io/v1beta1"
}

0 comments on commit d0d9374

Please sign in to comment.