-
Notifications
You must be signed in to change notification settings - Fork 845
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Atif Ali <[email protected]>
- Loading branch information
Showing
4 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
40 changes: 28 additions & 12 deletions
40
tests/k8s/1-046_validate_application_tracking/02-assert.yaml
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 |
---|---|---|
@@ -1,19 +1,35 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
metadata: | ||
name: assert-apps | ||
timeout: 300 | ||
--- | ||
# Check first Application exists | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
# Check first namespace labels | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: source-ns-1 | ||
labels: | ||
argocd.argoproj.io/managed-by: test-1-046-argocd-1 | ||
argocd.argoproj.io/tracking-id: instance-1 | ||
--- | ||
# Check second namespace labels | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: source-ns-2 | ||
labels: | ||
argocd.argoproj.io/managed-by: test-1-046-argocd-2 | ||
argocd.argoproj.io/tracking-id: instance-2 | ||
--- | ||
# Verify RBAC is set up for first namespace | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: test-app | ||
namespace: test-1-046-argocd-1 | ||
name: argocd-1-argocd-application-controller | ||
namespace: source-ns-1 | ||
--- | ||
# Check second Application exists | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
# Verify RBAC is set up for second namespace | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: test-app | ||
namespace: test-1-046-argocd-2 | ||
name: argocd-2-argocd-application-controller | ||
namespace: source-ns-2 |
13 changes: 13 additions & 0 deletions
13
tests/k8s/1-046_validate_application_tracking/02-label-namespaces.yaml
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,13 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
# Set managed-by labels | ||
- script: | | ||
kubectl label ns source-ns-1 argocd.argoproj.io/managed-by=test-1-046-argocd-1 | ||
kubectl label ns source-ns-2 argocd.argoproj.io/managed-by=test-1-046-argocd-2 | ||
sleep 30 | ||
# Set tracking-id labels | ||
- script: | | ||
kubectl label ns source-ns-1 argocd.argoproj.io/tracking-id=instance-1 | ||
kubectl label ns source-ns-2 argocd.argoproj.io/tracking-id=instance-2 | ||
sleep 30 |
27 changes: 27 additions & 0 deletions
27
tests/k8s/1-046_validate_application_tracking/03-assert.yaml
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,27 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 300 | ||
--- | ||
# Check first Application is healthy | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: test-app | ||
namespace: test-1-046-argocd-1 | ||
status: | ||
health: | ||
status: Healthy | ||
sync: | ||
status: Synced | ||
--- | ||
# Check second Application is healthy | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: test-app | ||
namespace: test-1-046-argocd-2 | ||
status: | ||
health: | ||
status: Healthy | ||
sync: | ||
status: Synced |
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