From 0b5b8971b122745441c6d53fb81150340d344036 Mon Sep 17 00:00:00 2001 From: andres-portainer <91705312+andres-portainer@users.noreply.github.com> Date: Thu, 16 Nov 2023 09:40:42 -0300 Subject: [PATCH] fix(gitops): handle the local environment in isEnvironmentOnline() EE-6321 (#10631) --- api/stacks/deployments/deploy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/stacks/deployments/deploy.go b/api/stacks/deployments/deploy.go index 2581818ef..e111e8001 100644 --- a/api/stacks/deployments/deploy.go +++ b/api/stacks/deployments/deploy.go @@ -11,6 +11,7 @@ import ( "github.com/portainer/portainer/api/dataservices" "github.com/portainer/portainer/api/git/update" "github.com/portainer/portainer/api/http/security" + "github.com/portainer/portainer/api/internal/endpointutils" "github.com/portainer/portainer/api/scheduler" "github.com/portainer/portainer/api/stacks/stackutils" @@ -171,6 +172,10 @@ func getUserRegistries(datastore dataservices.DataStore, user *portainer.User, e } func isEnvironmentOnline(endpoint *portainer.Endpoint) bool { + if endpointutils.IsLocalEndpoint(endpoint) { + return true + } + var err error var tlsConfig *tls.Config if endpoint.TLSConfig.TLS {