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

Commit

Permalink
KB-54: set default namespace if not specified on item create
Browse files Browse the repository at this point in the history
  • Loading branch information
uqee committed Dec 1, 2017
1 parent 9804233 commit 8ee1e59
Showing 1 changed file with 1 addition and 4 deletions.
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

0 comments on commit 8ee1e59

Please sign in to comment.