Skip to content

Commit

Permalink
Merge pull request #1 from godaddy/fhemberger-crd0
Browse files Browse the repository at this point in the history
Tweaks discussed in #149
  • Loading branch information
fhemberger committed Nov 11, 2017
2 parents 0e2e4e8 + 5b3ca64 commit 45b19eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/api-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ class ApiExtensions extends ApiGroup {
path: 'apis/apiextensions.k8s.io',
version: options.version || 'v1beta1',
groupResources: [
'customresourcedefinition'
'customresourcedefinitions'
],
namespaceResources: [
{ name: 'customresourcedefinition', Constructor: CustomResourceDefiniton }
{ name: 'customresourcedefinitions', Constructor: CustomResourceDefiniton }
]
});
super(options);
Expand Down
2 changes: 1 addition & 1 deletion lib/custom-resource-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const ApiGroup = require('./api-group');
class CustomResourceDefinition extends ApiGroup {
constructor(options) {
options = Object.assign({}, options, {
path: options.group,
path: `apis/${ options.group }`,
version: options.version || 'v1',
groupResources: [],
namespaceResources: []
Expand Down
8 changes: 4 additions & 4 deletions test/api-extensions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ describe('lib.apiextensions', () => {

beforeTesting('unit', () => {
nock(common.apiExtensions.url)
.post(`${ common.apiExtensions.path }`)
.post(`${ common.apiExtensions.path }/customresourcedefinitions`)
.reply(201, testApiExtensions)
.get(`${ common.apiExtensions.path }/${ testCustomResourceName }`)
.get(`${ common.apiExtensions.path }/customresourcedefinitions/${ testCustomResourceName }`)
.reply(200, testApiExtensions);
});

Expand All @@ -45,8 +45,8 @@ describe('lib.apiextensions', () => {
// improvements to our integration test harness to make this work well.
common.only('unit', 'can POST and GET', done => {
async.series([
next => common.apiExtensions.post({ body: testApiExtensions }, next),
next => common.apiExtensions.get(testCustomResourceName, next)
next => common.apiExtensions.customresourcedefinitions.post({ body: testApiExtensions }, next),
next => common.apiExtensions.customresourcedefinitions.get(testCustomResourceName, next)
], (err, results) => {
assume(err).is.falsy();
const getResult = results[1];
Expand Down

0 comments on commit 45b19eb

Please sign in to comment.