mirror of https://github.com/rancher/dashboard.git
Install cluster templates into fleet-default
This commit is contained in:
parent
bb393202e5
commit
ac458cf3c0
|
|
@ -31,6 +31,7 @@ import { clone, diff, get, set } from '@/utils/object';
|
|||
import { findBy, insertAt } from '@/utils/array';
|
||||
import Vue from 'vue';
|
||||
import { saferDump } from '@/utils/create-yaml';
|
||||
import { DEFAULT_WORKSPACE } from '@/models/provisioning.cattle.io.cluster';
|
||||
|
||||
const VALUES_STATE = {
|
||||
FORM: 'FORM',
|
||||
|
|
@ -78,26 +79,28 @@ export default {
|
|||
id: 'server-url'
|
||||
});
|
||||
|
||||
this.value = await this.$store.dispatch('cluster/create', {
|
||||
type: 'chartInstallAction',
|
||||
metadata: {
|
||||
namespace: this.existing ? this.existing.spec.namespace : this.query.appNamespace,
|
||||
name: this.existing ? this.existing.spec.name : this.query.appName,
|
||||
}
|
||||
});
|
||||
|
||||
if ( this.existing ) {
|
||||
this.forceNamespace = this.existing.metadata.namespace;
|
||||
this.nameDisabled = true;
|
||||
} else if (this.$route.query[FROM_CLUSTER] === _FLAGGED) {
|
||||
this.forceNamespace = DEFAULT_WORKSPACE;
|
||||
} else if ( this.chart?.targetNamespace ) {
|
||||
this.forceNamespace = this.chart.targetNamespace;
|
||||
} else if ( this.query.appNamespace ) {
|
||||
this.forceNamespace = this.query.appNamespace;
|
||||
} else {
|
||||
if ( this.chart?.targetNamespace ) {
|
||||
this.forceNamespace = this.chart.targetNamespace;
|
||||
} else if ( this.query.appNamespace ) {
|
||||
this.forceNamespace = this.query.appNamespace;
|
||||
} else {
|
||||
this.forceNamespace = null;
|
||||
}
|
||||
this.forceNamespace = null;
|
||||
}
|
||||
|
||||
this.value = await this.$store.dispatch('cluster/create', {
|
||||
type: 'chartInstallAction',
|
||||
metadata: {
|
||||
namespace: this.forceNamespace || this.$store.getters['defaultNamespace'],
|
||||
name: this.existing?.spec?.name || this.query.appName || '',
|
||||
}
|
||||
});
|
||||
|
||||
if ( !this.existing) {
|
||||
if ( this.chart?.targetName ) {
|
||||
this.value.metadata.name = this.chart.targetName;
|
||||
this.nameDisabled = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue