|
|
|
@ -13,6 +13,7 @@ import (
|
|
|
|
|
gittypes "github.com/portainer/portainer/api/git/types"
|
|
|
|
|
"github.com/portainer/portainer/api/git/update"
|
|
|
|
|
"github.com/portainer/portainer/api/http/security"
|
|
|
|
|
"github.com/portainer/portainer/api/internal/registryutils"
|
|
|
|
|
k "github.com/portainer/portainer/api/kubernetes"
|
|
|
|
|
"github.com/portainer/portainer/api/stacks/deployments"
|
|
|
|
|
|
|
|
|
@ -113,6 +114,14 @@ func (handler *Handler) updateKubernetesStack(r *http.Request, stack *portainer.
|
|
|
|
|
return httperror.InternalServerError("Failed to persist deployment file in a temp directory", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Refresh ECR registry secret if needed
|
|
|
|
|
// RefreshEcrSecret method checks if the namespace has any ECR registry
|
|
|
|
|
// otherwise return nil
|
|
|
|
|
cli, err := handler.KubernetesClientFactory.GetKubeClient(endpoint)
|
|
|
|
|
if err == nil {
|
|
|
|
|
registryutils.RefreshEcrSecret(cli, endpoint, handler.DataStore, stack.Namespace)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//use temp dir as the stack project path for deployment
|
|
|
|
|
//so if the deployment failed, the original file won't be over-written
|
|
|
|
|
stack.ProjectPath = tempFileDir
|
|
|
|
|