-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git@github.com:argoproj/argo-cd.git into 169…
…61-UpdateArgocdCm
- Loading branch information
Showing
3 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package e2e | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/argoproj/gitops-engine/pkg/health" | ||
. "github.com/argoproj/gitops-engine/pkg/sync/common" | ||
"github.com/stretchr/testify/assert" | ||
v1 "k8s.io/api/core/v1" | ||
|
||
. "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" | ||
. "github.com/argoproj/argo-cd/v2/test/e2e/fixture" | ||
. "github.com/argoproj/argo-cd/v2/test/e2e/fixture/app" | ||
) | ||
|
||
// Given application is set with --sync-option CreateNamespace=true and --sync-option ServerSideApply=true | ||
// | ||
// application --dest-namespace exists | ||
// | ||
// Then, --dest-namespace is created with server side apply | ||
// application is synced and healthy with resource | ||
// application resources created with server side apply in the newly created namespace. | ||
func TestNamespaceCreationWithSSA(t *testing.T) { | ||
SkipOnEnv(t, "OPENSHIFT") | ||
namespace := "guestbook-ui-with-ssa" | ||
defer func() { | ||
if !t.Skipped() { | ||
_, err := Run("", "kubectl", "delete", "namespace", namespace) | ||
assert.NoError(t, err) | ||
} | ||
}() | ||
|
||
ctx := Given(t) | ||
ctx. | ||
SetAppNamespace(AppNamespace()). | ||
Timeout(30). | ||
Path("guestbook"). | ||
When(). | ||
CreateFromFile(func(app *Application) { | ||
app.Spec.SyncPolicy = &SyncPolicy{ | ||
SyncOptions: SyncOptions{"CreateNamespace=true", "ServerSideApply=true"}, | ||
} | ||
}). | ||
Then(). | ||
Expect(NoNamespace(namespace)). | ||
When(). | ||
AppSet("--dest-namespace", namespace). | ||
Sync(). | ||
Then(). | ||
Expect(Success("")). | ||
Expect(Namespace(namespace, func(app *Application, ns *v1.Namespace) { | ||
assert.NotContains(t, ns.Annotations, "kubectl.kubernetes.io/last-applied-configuration") | ||
})). | ||
Expect(SyncStatusIs(SyncStatusCodeSynced)). | ||
Expect(HealthIs(health.HealthStatusHealthy)). | ||
Expect(OperationPhaseIs(OperationSucceeded)). | ||
Expect(ResourceHealthWithNamespaceIs("Deployment", "guestbook-ui", namespace, health.HealthStatusHealthy)). | ||
Expect(ResourceSyncStatusWithNamespaceIs("Deployment", "guestbook-ui", namespace, SyncStatusCodeSynced)). | ||
Expect(ResourceHealthWithNamespaceIs("Service", "guestbook-ui", namespace, health.HealthStatusHealthy)). | ||
Expect(ResourceSyncStatusWithNamespaceIs("Service", "guestbook-ui", namespace, SyncStatusCodeSynced)) | ||
} |