feat(helm): reuse existing git sources in Kubernetes Helm-from-git install [BE-13046] (#2900)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Chaim Lev-Ari
2026-06-15 22:01:31 +03:00
committed by GitHub
parent 491df61fbf
commit d9673e33ec
18 changed files with 348 additions and 151 deletions
@@ -0,0 +1,31 @@
package stacks
import (
"testing"
portainer "github.com/portainer/portainer/api"
"github.com/stretchr/testify/assert"
)
func TestComposeGitPayload_ValidateWithSourceID_URLNotRequired(t *testing.T) {
t.Parallel()
payload := &composeStackFromGitRepositoryPayload{
Name: "mystack",
SourceID: portainer.SourceID(1),
// RepositoryURL intentionally omitted
}
err := payload.Validate(nil)
assert.NoError(t, err)
}
func TestComposeGitPayload_ValidateWithoutSourceID_URLRequired(t *testing.T) {
t.Parallel()
payload := &composeStackFromGitRepositoryPayload{
Name: "mystack",
// SourceID and RepositoryURL both omitted
}
err := payload.Validate(nil)
assert.Error(t, err)
}