apply repo config from EE-161

This commit is contained in:
ArrisLee
2021-06-20 22:30:32 +12:00
parent b5ea45f81b
commit 90bbc18aab
5 changed files with 35 additions and 10 deletions
@@ -13,6 +13,7 @@ import (
"github.com/portainer/libhttp/request"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/filesystem"
gittypes "github.com/portainer/portainer/api/git/types"
"github.com/portainer/portainer/api/http/security"
)
@@ -168,7 +169,7 @@ func (handler *Handler) createComposeStackFromGitRepository(w http.ResponseWrite
AdditionalFiles: payload.AdditionalFiles,
AutoUpdate: payload.AutoUpdate,
Env: payload.Env,
GitConfig: &portainer.GitConfig{
GitConfig: &gittypes.RepoConfig{
URL: payload.RepositoryURL,
ReferenceName: payload.RepositoryReferenceName,
},
@@ -177,7 +178,7 @@ func (handler *Handler) createComposeStackFromGitRepository(w http.ResponseWrite
}
if payload.RepositoryAuthentication {
stack.GitConfig.Authentication = &portainer.GitAuthentication{
stack.GitConfig.Authentication = &gittypes.GitAuthentication{
Username: payload.RepositoryUsername,
Password: payload.RepositoryPassword,
}