diff --git a/api/http/handler/stacks/stack_update_git_redeploy.go b/api/http/handler/stacks/stack_update_git_redeploy.go index 250c67e61..c338757e0 100644 --- a/api/http/handler/stacks/stack_update_git_redeploy.go +++ b/api/http/handler/stacks/stack_update_git_redeploy.go @@ -1,7 +1,6 @@ package stacks import ( - "errors" "fmt" "log" "net/http" @@ -32,9 +31,6 @@ func (payload *stackGitRedployPayload) Validate(r *http.Request) error { payload.RepositoryReferenceName = defaultGitReferenceName } - if payload.RepositoryAuthentication && govalidator.IsNull(payload.RepositoryPassword) { - return errors.New("invalid repository credentials. Username and password must be specified when authentication is enabled") - } return nil } diff --git a/app/portainer/rest/stack.js b/app/portainer/rest/stack.js index 58f10fe47..d41bdf04a 100644 --- a/app/portainer/rest/stack.js +++ b/app/portainer/rest/stack.js @@ -5,7 +5,7 @@ angular.module('portainer.app').factory('Stack', [ function StackFactory($resource, EndpointProvider, API_ENDPOINT_STACKS) { 'use strict'; return $resource( - API_ENDPOINT_STACKS + '/:id/:action', + API_ENDPOINT_STACKS + '/:id/:action/:subaction', {}, { get: { method: 'GET', params: { id: '@id' } }, @@ -18,7 +18,7 @@ angular.module('portainer.app').factory('Stack', [ migrate: { method: 'POST', params: { id: '@id', action: 'migrate', endpointId: '@endpointId' }, ignoreLoadingBar: true }, start: { method: 'POST', params: { id: '@id', action: 'start' } }, stop: { method: 'POST', params: { id: '@id', action: 'stop' } }, - updateGit: { method: 'PUT', params: { id: '@id', action: 'git/redeploy' } }, + updateGit: { method: 'PUT', params: { id: '@id', action: 'git', subaction: 'redeploy' } }, updateGitStackSettings: { method: 'POST', params: { id: '@id', action: 'git' }, ignoreLoadingBar: true }, } );