From 5d75ca34ea7bf5f14c76af3077378ed5037804a4 Mon Sep 17 00:00:00 2001 From: Hao Zhang Date: Mon, 21 Feb 2022 08:43:22 +0800 Subject: [PATCH] fix(stack): git force pull image toggle only for non-kubernetes git based stacks (#6574) --- .../git-form-auto-update-fieldset.html | 2 +- .../stack-redeploy-git-form.controller.js | 2 ++ app/portainer/views/stacks/create/createStackController.js | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.html b/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.html index 4a3e09d9f..20877a2f0 100644 --- a/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.html +++ b/app/portainer/components/forms/git-form/git-form-auto-update-fieldset/git-form-auto-update-fieldset.html @@ -51,7 +51,7 @@ /> -
+
diff --git a/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js b/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js index b19c547f9..8f262dd7a 100644 --- a/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js +++ b/app/portainer/components/forms/stack-redeploy-git-form/stack-redeploy-git-form.controller.js @@ -34,6 +34,7 @@ class StackRedeployGitFormController { RepositoryMechanism: RepositoryMechanismTypes.INTERVAL, RepositoryFetchInterval: '5m', RepositoryWebhookURL: '', + ShowForcePullImage: false, }, }; @@ -151,6 +152,7 @@ class StackRedeployGitFormController { // Init auto update if (this.stack.AutoUpdate && (this.stack.AutoUpdate.Interval || this.stack.AutoUpdate.Webhook)) { this.formValues.AutoUpdate.RepositoryAutomaticUpdates = true; + this.formValues.AutoUpdate.ShowForcePullImage = this.stack.Type !== 3; if (this.stack.AutoUpdate.Interval) { this.formValues.AutoUpdate.RepositoryMechanism = RepositoryMechanismTypes.INTERVAL; diff --git a/app/portainer/views/stacks/create/createStackController.js b/app/portainer/views/stacks/create/createStackController.js index 65c300cb4..13709354e 100644 --- a/app/portainer/views/stacks/create/createStackController.js +++ b/app/portainer/views/stacks/create/createStackController.js @@ -53,6 +53,7 @@ angular RepositoryMechanism: RepositoryMechanismTypes.INTERVAL, RepositoryFetchInterval: '5m', RepositoryWebhookURL: WebhookHelper.returnStackWebhookUrl(uuidv4()), + ShowForcePullImage: false, }; $scope.state = { @@ -312,7 +313,7 @@ angular } $scope.composeSyntaxMaxVersion = endpoint.ComposeSyntaxMaxVersion; - + $scope.formValues.ShowForcePullImage = $scope.state.StackType !== 3; try { const containers = await ContainerService.containers(true); $scope.containerNames = ContainerHelper.getContainerNames(containers);