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:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user