mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
fix(helm): fix helm move to advance deployments issues [EE-5999] (#10453)
* fix helm move to adv deployments
This commit is contained in:
parent
7218eb0892
commit
ff5b311eee
17 changed files with 39 additions and 24 deletions
|
@ -82,16 +82,6 @@ angular.module('portainer.kubernetes', ['portainer.app', registriesModule, custo
|
|||
},
|
||||
};
|
||||
|
||||
const helmTemplates = {
|
||||
name: 'kubernetes.templates.helm',
|
||||
url: '/helm',
|
||||
views: {
|
||||
'content@': {
|
||||
component: 'helmTemplatesView',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const services = {
|
||||
name: 'kubernetes.services',
|
||||
url: '/services',
|
||||
|
@ -480,7 +470,6 @@ angular.module('portainer.kubernetes', ['portainer.app', registriesModule, custo
|
|||
|
||||
$stateRegistryProvider.register(kubernetes);
|
||||
$stateRegistryProvider.register(helmApplication);
|
||||
$stateRegistryProvider.register(helmTemplates);
|
||||
$stateRegistryProvider.register(applications);
|
||||
$stateRegistryProvider.register(applicationCreation);
|
||||
$stateRegistryProvider.register(application);
|
||||
|
|
|
@ -31,10 +31,6 @@
|
|||
<div class="mb-2 small"
|
||||
>Select the Helm chart to use. Bring further Helm charts into your selection list via <a ui-sref="portainer.account">User settings - Helm repositories</a>.</div
|
||||
>
|
||||
<beta-alert
|
||||
is-html="true"
|
||||
message="'Beta feature - so far, this functionality has been tested in limited scenarios. For more information, see this <a href=\'https://www.portainer.io/blog/portainer-now-with-helm-support\' target=\'_blank\' class=\'hyperlink\'>blog post on Portainer Helm support</a>.'"
|
||||
></beta-alert>
|
||||
</div>
|
||||
|
||||
<div class="blocklist !px-0">
|
||||
|
|
|
@ -23,6 +23,7 @@ export default class HelmTemplatesController {
|
|||
this.getHelmRepoURLs = this.getHelmRepoURLs.bind(this);
|
||||
this.getLatestCharts = this.getLatestCharts.bind(this);
|
||||
this.getResourcePools = this.getResourcePools.bind(this);
|
||||
this.clearHelmChart = this.clearHelmChart.bind(this);
|
||||
|
||||
$window.onbeforeunload = () => {
|
||||
if (this.state.isEditorDirty) {
|
||||
|
@ -31,6 +32,11 @@ export default class HelmTemplatesController {
|
|||
};
|
||||
}
|
||||
|
||||
clearHelmChart() {
|
||||
this.state.chart = null;
|
||||
this.onSelectHelmChart('');
|
||||
}
|
||||
|
||||
editorUpdate(contentvalues) {
|
||||
if (this.state.originalvalues === contentvalues) {
|
||||
this.state.isEditorDirty = false;
|
||||
|
@ -85,6 +91,7 @@ export default class HelmTemplatesController {
|
|||
window.scrollTo(0, 0);
|
||||
this.state.showCustomValues = false;
|
||||
this.state.chart = chart;
|
||||
this.onSelectHelmChart(chart.name);
|
||||
await this.getHelmValues();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
<div class="basis-1/4">
|
||||
<div class="h-full w-full vertical-center justify-end pr-5">
|
||||
<button type="button" class="btn btn-sm btn-link !text-gray-8 hover:no-underline th-highcontrast:!text-white th-dark:!text-white" ng-click="$ctrl.state.chart = null">
|
||||
<button type="button" class="btn btn-sm btn-link !text-gray-8 hover:no-underline th-highcontrast:!text-white th-dark:!text-white" ng-click="$ctrl.clearHelmChart()">
|
||||
Clear selection
|
||||
<pr-icon icon="'x'" class="ml-1"></pr-icon>
|
||||
</button>
|
||||
|
|
|
@ -8,5 +8,6 @@ angular.module('portainer.kubernetes').component('helmTemplatesView', {
|
|||
endpoint: '<',
|
||||
namespace: '<',
|
||||
stackName: '<',
|
||||
onSelectHelmChart: '<',
|
||||
},
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 form-section-title"> Build method </div>
|
||||
<div class="col-sm-12 form-section-title"> Deploy from </div>
|
||||
<box-selector
|
||||
slim="true"
|
||||
radio-name="'method'"
|
||||
|
@ -167,7 +167,13 @@
|
|||
|
||||
<!-- Helm -->
|
||||
<div ng-show="ctrl.state.BuildMethod === ctrl.BuildMethods.HELM">
|
||||
<helm-templates-view endpoint="ctrl.endpoint" namespace="ctrl.formValues.Namespace" stack-name="ctrl.formValues.StackName"></helm-templates-view>
|
||||
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.selectedHelmChart">Selected Helm chart</div>
|
||||
<helm-templates-view
|
||||
on-select-helm-chart="(ctrl.onSelectHelmChart)"
|
||||
endpoint="ctrl.endpoint"
|
||||
namespace="ctrl.formValues.Namespace"
|
||||
stack-name="ctrl.formValues.StackName"
|
||||
></helm-templates-view>
|
||||
</div>
|
||||
<!-- !Helm -->
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ class KubernetesDeployController {
|
|||
{ ...git, value: KubernetesDeployBuildMethods.GIT },
|
||||
{ ...editor, value: KubernetesDeployBuildMethods.WEB_EDITOR },
|
||||
{ ...url, value: KubernetesDeployBuildMethods.URL },
|
||||
{ ...customTemplate, value: KubernetesDeployBuildMethods.CUSTOM_TEMPLATE },
|
||||
{ ...customTemplate, description: 'Use custom template', value: KubernetesDeployBuildMethods.CUSTOM_TEMPLATE },
|
||||
{ ...helm, value: KubernetesDeployBuildMethods.HELM },
|
||||
];
|
||||
|
@ -55,6 +54,7 @@ class KubernetesDeployController {
|
|||
webhookId: createWebhookId(),
|
||||
templateLoadFailed: false,
|
||||
isEditorReadOnly: false,
|
||||
selectedHelmChart: '',
|
||||
};
|
||||
|
||||
this.currentUser = {
|
||||
|
@ -79,6 +79,7 @@ class KubernetesDeployController {
|
|||
this.ManifestDeployTypes = KubernetesDeployManifestTypes;
|
||||
this.BuildMethods = KubernetesDeployBuildMethods;
|
||||
|
||||
this.onSelectHelmChart = this.onSelectHelmChart.bind(this);
|
||||
this.onChangeTemplateId = this.onChangeTemplateId.bind(this);
|
||||
this.deployAsync = this.deployAsync.bind(this);
|
||||
this.onChangeFileContent = this.onChangeFileContent.bind(this);
|
||||
|
@ -90,6 +91,10 @@ class KubernetesDeployController {
|
|||
this.onChangeTemplateVariables = this.onChangeTemplateVariables.bind(this);
|
||||
}
|
||||
|
||||
onSelectHelmChart(chart) {
|
||||
this.state.selectedHelmChart = chart;
|
||||
}
|
||||
|
||||
onChangeTemplateVariables(value) {
|
||||
this.onChangeFormValues({ Variables: value });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue