diff --git a/cmd/helm_update.go b/cmd/helm_update.go index 8e36295d..c78e8b4a 100644 --- a/cmd/helm_update.go +++ b/cmd/helm_update.go @@ -121,10 +121,14 @@ func GetHelmSource(helm *qovery.HelmResponse, chartName string, chartVersion str updatedBranch = &charGitCommitBranch } + if gitRepository.Url == nil { + return nil, fmt.Errorf("Invalid Helm git repository source") + } + return &qovery.HelmRequestAllOfSource{ HelmRequestAllOfSourceOneOf: &qovery.HelmRequestAllOfSourceOneOf{ GitRepository: &qovery.HelmGitRepositoryRequest{ - Url: gitRepository.Url, + Url: *gitRepository.Url, Branch: updatedBranch, RootPath: gitRepository.RootPath, GitTokenId: gitRepository.GitTokenId, @@ -172,9 +176,13 @@ func GetHelmValuesOverride(helm *qovery.HelmResponse, valuesOverrideCommitBranch updatedBranch = &valuesOverrideCommitBranch } + if git.GitRepository.Url == nil { + return nil, fmt.Errorf("Invalid Helm git repository source") + } + updatedFile := qovery.HelmRequestAllOfValuesOverrideFile{} updatedFile.SetGitRepository(qovery.HelmValuesGitRepositoryRequest{ - Url: git.GitRepository.Url, + Url: *git.GitRepository.Url, Branch: *updatedBranch, Paths: git.Paths, GitTokenId: git.GitRepository.GitTokenId, diff --git a/go.mod b/go.mod index ff057c4c..daefb76e 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/posthog/posthog-go v0.0.0-20221221115252-24dfed35d71a github.com/pterm/pterm v0.12.55 - github.com/qovery/qovery-client-go v0.0.0-20231222093609-d7ae5a912bea + github.com/qovery/qovery-client-go v0.0.0-20240102111457-e9d5e9a578cd github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 63ac30e8..095f683f 100644 --- a/go.sum +++ b/go.sum @@ -194,6 +194,8 @@ github.com/qovery/qovery-client-go v0.0.0-20231219130711-1b52194296f5 h1:uTmfOdy github.com/qovery/qovery-client-go v0.0.0-20231219130711-1b52194296f5/go.mod h1:5QD7sC1Z6XCCYd31c4XKVwGdEOjvtgG0NDcaVDoWb+o= github.com/qovery/qovery-client-go v0.0.0-20231222093609-d7ae5a912bea h1:/MLgKpXXPqTJBclZ1kFbC42BXQjl77+COijlmiFpnBg= github.com/qovery/qovery-client-go v0.0.0-20231222093609-d7ae5a912bea/go.mod h1:5QD7sC1Z6XCCYd31c4XKVwGdEOjvtgG0NDcaVDoWb+o= +github.com/qovery/qovery-client-go v0.0.0-20240102111457-e9d5e9a578cd h1:K3H0JYTE+VN7hIo2T/UlKgDCbL2Z8Om7vkqrhVVP7og= +github.com/qovery/qovery-client-go v0.0.0-20240102111457-e9d5e9a578cd/go.mod h1:5QD7sC1Z6XCCYd31c4XKVwGdEOjvtgG0NDcaVDoWb+o= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= diff --git a/utils/qovery.go b/utils/qovery.go index 2be35b0e..ad1184e9 100644 --- a/utils/qovery.go +++ b/utils/qovery.go @@ -1665,7 +1665,7 @@ func DeployHelms(client *qovery.APIClient, envId string, helmNames string, chart return deployAllServices(client, envId, req) } -func GetGitSource(helm *qovery.HelmResponse) *qovery.ApplicationGitRepositoryRequest { +func GetGitSource(helm *qovery.HelmResponse) *qovery.ApplicationGitRepository { if helm.Source.HelmResponseAllOfSourceOneOf != nil && helm.Source.HelmResponseAllOfSourceOneOf.Git != nil { return helm.Source.HelmResponseAllOfSourceOneOf.Git.GitRepository }