Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/KB-54' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
uqee committed Dec 1, 2017
2 parents c9defdd + a3332c7 commit 1f7c4a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kubernator",
"version": "0.14.7",
"version": "0.14.8",
"private": true,
"dependencies": {
"@uqee/immutability-helper-x": "^0.2.1",
Expand Down
5 changes: 1 addition & 4 deletions src/modules/k8s/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,8 @@ function* sagaItemPost() {
const resource = yield select(resourceSelectByKindAndVersion, kind, itemGetVersionByApiVersion(apiVersion));
if (!resource) throw new Error('Can\'t find correponding resource by apiVersion and kind.');

// get url
const { namespaced, [URL]: resourceUrl } = resource;
const url = namespaced ? resourceGetUrl(resource, namespace) : resourceUrl;

// post
const url = resourceGetUrl(resource, namespace || 'default');
const item = yield call(itemApiPost, url, yaml);
if (item.status === 'Failure') throw item;

Expand Down
2 changes: 1 addition & 1 deletion src/modules/k8s/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function resourceDecorate(group, version) {
}

export function resourceGetUrl(resource, namespace) {
return namespace
return resource.namespaced && namespace
? `${resource[URL_PART_GROUP]}/namespaces/${namespace}/${resource[URL_PART_RESOURCE]}`
: resource[URL];
}

0 comments on commit 1f7c4a9

Please sign in to comment.