mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
* refactor(util/git/client): make runCredentialedCmd() signature coherent with runCmd() one Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com> * fix(repo-server): completely clean up Git working directory In some cases, for example when a Git submodule wasn’t present anymore in a Git revision, the repo-server didn’t completely clean up its Git working directory. Fixes #3683 Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com> --------- Signed-off-by: Yann Soubeyrand <yann.soubeyrand@camptocamp.com>
64 lines
1.6 KiB
Go
64 lines
1.6 KiB
Go
package e2e
|
|
|
|
import (
|
|
"testing"
|
|
|
|
v1 "k8s.io/api/core/v1"
|
|
|
|
"github.com/argoproj/argo-cd/v2/test/e2e/fixture"
|
|
|
|
. "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
|
|
. "github.com/argoproj/argo-cd/v2/test/e2e/fixture/app"
|
|
)
|
|
|
|
func TestGitSubmoduleSSHSupport(t *testing.T) {
|
|
Given(t).
|
|
RepoURLType(fixture.RepoURLTypeSSHSubmoduleParent).
|
|
Path("submodule").
|
|
Recurse().
|
|
CustomSSHKnownHostsAdded().
|
|
SubmoduleSSHRepoURLAdded(true).
|
|
When().
|
|
CreateFromFile(func(app *Application) {}).
|
|
Sync().
|
|
Then().
|
|
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
|
Expect(Pod(func(p v1.Pod) bool { return p.Name == "pod-in-submodule" }))
|
|
}
|
|
|
|
func TestGitSubmoduleHTTPSSupport(t *testing.T) {
|
|
Given(t).
|
|
RepoURLType(fixture.RepoURLTypeHTTPSSubmoduleParent).
|
|
Path("submodule").
|
|
Recurse().
|
|
CustomCACertAdded().
|
|
SubmoduleHTTPSRepoURLAdded(true).
|
|
When().
|
|
CreateFromFile(func(app *Application) {}).
|
|
Sync().
|
|
Then().
|
|
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
|
Expect(Pod(func(p v1.Pod) bool { return p.Name == "pod-in-submodule" }))
|
|
}
|
|
|
|
func TestGitSubmoduleRemovalSupport(t *testing.T) {
|
|
Given(t).
|
|
RepoURLType(fixture.RepoURLTypeSSHSubmoduleParent).
|
|
Path("submodule").
|
|
Recurse().
|
|
CustomSSHKnownHostsAdded().
|
|
SubmoduleSSHRepoURLAdded(true).
|
|
When().
|
|
CreateFromFile(func(app *Application) {}).
|
|
Sync().
|
|
Then().
|
|
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
|
Expect(Pod(func(p v1.Pod) bool { return p.Name == "pod-in-submodule" })).
|
|
When().
|
|
RemoveSubmodule().
|
|
Refresh(RefreshTypeNormal).
|
|
Sync().
|
|
Then().
|
|
Expect(SyncStatusIs(SyncStatusCodeSynced)).
|
|
Expect(NotPod(func(p v1.Pod) bool { return p.Name == "pod-in-submodule" }))
|
|
}
|