From b5c59c898291560a84a21a361ab61ec08fde054d Mon Sep 17 00:00:00 2001 From: Felix Han Date: Tue, 31 Aug 2021 15:39:44 +1200 Subject: [PATCH] updated API response to get IsComposeFormat and show appropriate text. --- .../create/createApplication.html | 29 ++++++++++++++----- .../create/createApplicationController.js | 5 ++-- app/portainer/models/stack.js | 1 + 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/app/kubernetes/views/applications/create/createApplication.html b/app/kubernetes/views/applications/create/createApplication.html index 18e442413..ec9ed0002 100644 --- a/app/kubernetes/views/applications/create/createApplication.html +++ b/app/kubernetes/views/applications/create/createApplication.html @@ -72,14 +72,27 @@ on-change="(ctrl.onChangeFileContent)" > -

- - This feature allows you to deploy any kind of Kubernetes resource in this environment (Deployment, Secret, ConfigMap...). -

-

- You can get more information about Kubernetes file format in the - official documentation. -

+ +

+ + Portainer uses Kompose to convert your Compose manifest to a Kubernetes compliant manifest. Be wary that not + all the Compose format options are supported by Kompose at the moment. +

+

+ You can get more information about Compose file format in the + official documentation. +

+
+ +

+ + This feature allows you to deploy any kind of Kubernetes resource in this environment (Deployment, Secret, ConfigMap...). +

+

+ You can get more information about Kubernetes file format in the + official documentation. +

+
diff --git a/app/kubernetes/views/applications/create/createApplicationController.js b/app/kubernetes/views/applications/create/createApplicationController.js index 12953d6b9..bded4257f 100644 --- a/app/kubernetes/views/applications/create/createApplicationController.js +++ b/app/kubernetes/views/applications/create/createApplicationController.js @@ -1024,9 +1024,8 @@ class KubernetesCreateApplicationController { if (this.application.ApplicationKind) { this.state.appType = this.KubernetesDeploymentTypes[this.application.ApplicationKind.toUpperCase()]; if (this.application.StackId) { - if (this.application.ApplicationKind === this.KubernetesDeploymentTypes.GIT) { - this.stack = await this.StackService.stack(this.application.StackId); - } else if (this.application.ApplicationKind === this.KubernetesDeploymentTypes.CONTENT) { + this.stack = await this.StackService.stack(this.application.StackId); + if (this.application.ApplicationKind === this.KubernetesDeploymentTypes.CONTENT) { this.stackFileContent = await this.StackService.getStackFile(this.application.StackId); } } diff --git a/app/portainer/models/stack.js b/app/portainer/models/stack.js index 41c32f70f..118174d0a 100644 --- a/app/portainer/models/stack.js +++ b/app/portainer/models/stack.js @@ -7,6 +7,7 @@ export function StackViewModel(data) { this.EndpointId = data.EndpointId; this.SwarmId = data.SwarmId; this.Env = data.Env ? data.Env : []; + this.IsComposeFormat = data.IsComposeFormat; if (data.ResourceControl && data.ResourceControl.Id !== 0) { this.ResourceControl = new ResourceControlViewModel(data.ResourceControl); }