diff --git a/api/http/handler/endpointproxy/proxy_kubernetes.go b/api/http/handler/endpointproxy/proxy_kubernetes.go index ed5b1a28b..1f6ed3bfd 100644 --- a/api/http/handler/endpointproxy/proxy_kubernetes.go +++ b/api/http/handler/endpointproxy/proxy_kubernetes.go @@ -77,5 +77,5 @@ func (handler *Handler) proxyRequestsToKubernetesAPI(w http.ResponseWriter, r *h } func isKubernetesRequest(requestURL string) bool { - return strings.HasPrefix(requestURL, "/api") + return strings.HasPrefix(requestURL, "/api") || strings.HasPrefix(requestURL, "/healthz") } diff --git a/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js b/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js index bcef9c9f6..5e6482ee4 100644 --- a/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js +++ b/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js @@ -5,7 +5,9 @@ export class EditEdgeStackFormController { } editorUpdate(cm) { - this.model.StackFileContent = cm.getValue(); - this.isEditorDirty = true; + if (this.model.StackFileContent.replace(/(\r\n|\n|\r)/gm, '') !== cm.getValue().replace(/(\r\n|\n|\r)/gm, '')) { + this.model.StackFileContent = cm.getValue(); + this.isEditorDirty = true; + } } } diff --git a/app/kubernetes/components/kubernetes-configuration-data/kubernetesConfigurationDataController.js b/app/kubernetes/components/kubernetes-configuration-data/kubernetesConfigurationDataController.js index 593fdc347..af7685b12 100644 --- a/app/kubernetes/components/kubernetes-configuration-data/kubernetesConfigurationDataController.js +++ b/app/kubernetes/components/kubernetes-configuration-data/kubernetesConfigurationDataController.js @@ -43,8 +43,10 @@ class KubernetesConfigurationDataController { } async editorUpdateAsync(cm) { - this.formValues.DataYaml = cm.getValue(); - this.isEditorDirty = true; + if (this.formValues.DataYaml !== cm.getValue()) { + this.formValues.DataYaml = cm.getValue(); + this.isEditorDirty = true; + } } editorUpdate(cm) { diff --git a/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js b/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js index e53e291e3..941d1870b 100644 --- a/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js +++ b/app/portainer/views/custom-templates/edit-custom-template-view/editCustomTemplateViewController.js @@ -96,8 +96,10 @@ class EditCustomTemplateViewController { } editorUpdate(cm) { - this.formValues.FileContent = cm.getValue(); - this.state.isEditorDirty = true; + if (this.formValues.FileContent.replace(/(\r\n|\n|\r)/gm, '') !== cm.getValue().replace(/(\r\n|\n|\r)/gm, '')) { + this.formValues.FileContent = cm.getValue(); + this.state.isEditorDirty = true; + } } async uiCanExit() { diff --git a/app/portainer/views/stacks/edit/stackController.js b/app/portainer/views/stacks/edit/stackController.js index f7e8b05d2..26eca7f2e 100644 --- a/app/portainer/views/stacks/edit/stackController.js +++ b/app/portainer/views/stacks/edit/stackController.js @@ -201,12 +201,11 @@ angular.module('portainer.app').controller('StackController', [ }; $scope.editorUpdate = function (cm) { - if ($scope.stackFileContent !== cm.getValue()) { + if ($scope.stackFileContent.replace(/(\r\n|\n|\r)/gm, '') !== cm.getValue().replace(/(\r\n|\n|\r)/gm, '')) { $scope.state.isEditorDirty = true; + $scope.stackFileContent = cm.getValue(); + $scope.state.yamlError = StackHelper.validateYAML($scope.stackFileContent, $scope.containerNames); } - $scope.stackFileContent = cm.getValue(); - $scope.state.yamlError = StackHelper.validateYAML($scope.stackFileContent, $scope.containerNames); - $scope.state.isEditorDirty = true; }; $scope.stopStack = stopStack; @@ -269,8 +268,7 @@ angular.module('portainer.app').controller('StackController', [ var stack = data.stack; $scope.groups = data.groups; $scope.stack = stack; - $scope.containers = data.containers; - $scope.containerNames = ContainerHelper.getContainerNames($scope.containers); + $scope.containerNames = ContainerHelper.getContainerNames(data.containers); let resourcesPromise = Promise.resolve({}); if (stack.Status === 1) {