Skip to content

Commit

Permalink
don't set template namespace
Browse files Browse the repository at this point in the history
Signed-off-by: yaacov <kobi.zamir@gmail.com>
  • Loading branch information
yaacov committed Mar 10, 2020
1 parent 91a7ad1 commit 9439d63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -125,6 +125,7 @@ export const createVM = async (params: CreateVMParams) => {

// ProcessedTemplates endpoint will reject the request if user cannot post to the namespace
// common-templates are stored in openshift namespace, default user can read but cannot post
const templateNamespace = template.getNamespace();
template
.setNamespace(namespace)
.setParameter(TEMPLATE_PARAM_VM_NAME, combinedSimpleSettings[VMSettingsField.NAME])
Expand All @@ -144,6 +145,9 @@ export const createVM = async (params: CreateVMParams) => {
{ disableHistory: true },
); // temporary

// Re-set template namespace
template.setNamespace(templateNamespace);

vm = new VMWrapper(selectVM(processedTemplate));
vm.setNamespace(namespace);
initializeCommonMetadata(combinedSimpleSettings, vm, template.asResource());
Expand Down
@@ -1,5 +1,5 @@
/* eslint-disable lines-between-class-members */
import { getName, hasLabel, getLabels } from '@console/shared/src';
import { getName, getNamespace, hasLabel, getLabels } from '@console/shared/src';
import { apiVersionForModel, K8sKind, K8sResourceKind } from '@console/internal/module/k8s';
import { Wrapper } from './wrapper';
import { K8sResourceKindMethods } from '../types/types';
Expand All @@ -9,6 +9,7 @@ export class K8sResourceWrapper<
SELF extends K8sResourceWrapper<RESOURCE, SELF>
> extends Wrapper<RESOURCE, SELF> implements K8sResourceKindMethods {
getName = () => getName(this.data);
getNamespace = () => getNamespace(this.data);
getLabels = (defaultValue = {}) => getLabels(this.data, defaultValue);
hasLabel = (label: string) => hasLabel(this.data, label);

Expand Down

0 comments on commit 9439d63

Please sign in to comment.