mirror of https://github.com/rancher/dashboard.git
Fleet rename helmapps to helmops; fix cluster registriy and chart values handling
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
parent
28dbb4f114
commit
a6d97f6833
|
|
@ -2590,7 +2590,7 @@ fleet:
|
||||||
subTypes:
|
subTypes:
|
||||||
fleet.cattle.io.gitrepo:
|
fleet.cattle.io.gitrepo:
|
||||||
description: GitRepos text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
|
description: GitRepos text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
|
||||||
fleet.cattle.io.helmapp:
|
fleet.cattle.io.helmop:
|
||||||
description: HelmOps text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
|
description: HelmOps text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
|
||||||
warningTooltip:
|
warningTooltip:
|
||||||
clusterGroup: There are no clusters in this Cluster Group
|
clusterGroup: There are no clusters in this Cluster Group
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import FleetBundles from '@shell/components/fleet/FleetBundles.vue';
|
||||||
import { checkSchemasForFindAllHash } from '@shell/utils/auth';
|
import { checkSchemasForFindAllHash } from '@shell/utils/auth';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DetailhelmOp',
|
name: 'DetailsHelmOp',
|
||||||
|
|
||||||
emits: ['input'],
|
emits: ['input'],
|
||||||
|
|
||||||
|
|
@ -181,7 +181,9 @@ export default {
|
||||||
tempCachedValues: {},
|
tempCachedValues: {},
|
||||||
valueFromOptions,
|
valueFromOptions,
|
||||||
doneRouteList: 'c-cluster-fleet-application',
|
doneRouteList: 'c-cluster-fleet-application',
|
||||||
chartValues: {}
|
chartValues: {},
|
||||||
|
clusterRegistry: null,
|
||||||
|
fetchChartValues: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -268,7 +270,7 @@ export default {
|
||||||
out.push({
|
out.push({
|
||||||
disabled: true,
|
disabled: true,
|
||||||
kind: 'title',
|
kind: 'title',
|
||||||
label: this.t('fleet.helmOp.source.registryOption')
|
label: this.t('fleet.helmOp.source.registry.option')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -446,9 +448,15 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onSourceTypeSelect(value) {
|
onSourceTypeSelect(value) {
|
||||||
|
delete this.value.spec.helm.repo;
|
||||||
|
delete this.value.spec.helm.chart;
|
||||||
|
delete this.value.spec.helm.version;
|
||||||
|
|
||||||
if (value.isClusterRegistry) {
|
if (value.isClusterRegistry) {
|
||||||
const registry = this.registries.find((registry) => registry._key === value.key);
|
const registry = this.registries.find((registry) => registry._key === value.key);
|
||||||
|
|
||||||
|
this.clusterRegistry = registry;
|
||||||
|
|
||||||
this.value.spec.helm.repo = registry.spec.url;
|
this.value.spec.helm.repo = registry.spec.url;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -490,9 +498,24 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getChartValues(version) {
|
async getChartValues(version) {
|
||||||
const res = await this.$store.dispatch('management/request', { url: `/v1/${ REPO_CATALOG.CLUSTER_REPO }/${ version.repoName }?link=info&chartName=${ version.name }&version=${ version.version }` });
|
this.fetchChartValues = true;
|
||||||
|
|
||||||
this.value.spec.helm.values = saferDump(res?.values || {});
|
try {
|
||||||
|
const res = await this.$store.dispatch('management/request', { url: `/v1/${ REPO_CATALOG.CLUSTER_REPO }/${ version.repoName }?link=info&chartName=${ version.name }&version=${ version.version }` });
|
||||||
|
|
||||||
|
if (res?.values) {
|
||||||
|
this.chartValues = saferDump(res?.values || {});
|
||||||
|
|
||||||
|
this.value.spec.helm.values = res?.values;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fetchChartValues = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
updateChartValues(values) {
|
||||||
|
this.value.spec.helm.values = values;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateTargets() {
|
updateTargets() {
|
||||||
|
|
@ -820,6 +843,13 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Banner
|
||||||
|
v-if="clusterRegistry?.stateObj?.error"
|
||||||
|
class="col"
|
||||||
|
color="error"
|
||||||
|
:label="t('fleet.helmOp.source.registry.error', { registry: clusterRegistry.name })"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="row mb-20">
|
<div class="row mb-20">
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<LabeledSelect
|
<LabeledSelect
|
||||||
|
|
@ -869,7 +899,10 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="mb-15">
|
<div
|
||||||
|
v-if="!fetchChartValues"
|
||||||
|
class="mb-15"
|
||||||
|
>
|
||||||
<h3 v-t="'fleet.helmOp.values.values.selectLabel'" />
|
<h3 v-t="'fleet.helmOp.values.values.selectLabel'" />
|
||||||
<div
|
<div
|
||||||
v-if="!isView"
|
v-if="!isView"
|
||||||
|
|
@ -885,7 +918,7 @@ export default {
|
||||||
class="yaml-form-controls-spacer"
|
class="yaml-form-controls-spacer"
|
||||||
style="flex:1"
|
style="flex:1"
|
||||||
>
|
>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<ButtonGroup
|
<ButtonGroup
|
||||||
v-if="showYamlDiff"
|
v-if="showYamlDiff"
|
||||||
|
|
@ -912,13 +945,14 @@ export default {
|
||||||
<YamlEditor
|
<YamlEditor
|
||||||
v-if="yamlForm === VALUES_STATE.YAML"
|
v-if="yamlForm === VALUES_STATE.YAML"
|
||||||
ref="yaml"
|
ref="yaml"
|
||||||
v-model:value="value.spec.helm.values"
|
v-model:value="chartValues"
|
||||||
class="step__values__content"
|
class="step__values__content"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
:scrolling="true"
|
:scrolling="true"
|
||||||
:initial-yaml-values="defaultYamlValues"
|
:initial-yaml-values="defaultYamlValues"
|
||||||
:editor-mode="editorMode"
|
:editor-mode="editorMode"
|
||||||
:hide-preview-buttons="true"
|
:hide-preview-buttons="true"
|
||||||
|
@update:value="updateChartValues"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -938,6 +972,14 @@ export default {
|
||||||
/> -->
|
/> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
class="loading"
|
||||||
|
>
|
||||||
|
<span>{{ t('fleet.helmOp.values.values.loading') }}</span>
|
||||||
|
<i class="icon icon-spin icon-spinner" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- <div class="mb-15">
|
<!-- <div class="mb-15">
|
||||||
<ArrayList
|
<ArrayList
|
||||||
v-model:value="value.spec.helm.valuesFiles"
|
v-model:value="value.spec.helm.valuesFiles"
|
||||||
|
|
@ -1125,4 +1167,13 @@ export default {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
}
|
}
|
||||||
|
.loading {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 20px 0 20px 5px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue