Skip to content

Commit 7ecff26

Browse files
committed
create apps and assert pass
Signed-off-by: Atif Ali <[email protected]>
1 parent e24cbe6 commit 7ecff26

File tree

4 files changed

+74
-17
lines changed

4 files changed

+74
-17
lines changed
Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
apiVersion: kuttl.dev/v1beta1
22
kind: TestAssert
3-
metadata:
4-
name: assert-apps
53
timeout: 300
64
---
7-
# Check first Application exists
8-
apiVersion: argoproj.io/v1alpha1
9-
kind: Application
5+
# Check first namespace labels
6+
apiVersion: v1
7+
kind: Namespace
8+
metadata:
9+
name: source-ns-1
10+
labels:
11+
argocd.argoproj.io/managed-by: test-1-046-argocd-1
12+
argocd.argoproj.io/tracking-id: instance-1
13+
---
14+
# Check second namespace labels
15+
apiVersion: v1
16+
kind: Namespace
17+
metadata:
18+
name: source-ns-2
19+
labels:
20+
argocd.argoproj.io/managed-by: test-1-046-argocd-2
21+
argocd.argoproj.io/tracking-id: instance-2
22+
---
23+
# Verify RBAC is set up for first namespace
24+
apiVersion: rbac.authorization.k8s.io/v1
25+
kind: Role
1026
metadata:
11-
name: test-app
12-
namespace: test-1-046-argocd-1
27+
name: argocd-1-argocd-application-controller
28+
namespace: source-ns-1
1329
---
14-
# Check second Application exists
15-
apiVersion: argoproj.io/v1alpha1
16-
kind: Application
30+
# Verify RBAC is set up for second namespace
31+
apiVersion: rbac.authorization.k8s.io/v1
32+
kind: Role
1733
metadata:
18-
name: test-app
19-
namespace: test-1-046-argocd-2
34+
name: argocd-2-argocd-application-controller
35+
namespace: source-ns-2
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
# Set managed-by labels
5+
- script: |
6+
kubectl label ns source-ns-1 argocd.argoproj.io/managed-by=test-1-046-argocd-1
7+
kubectl label ns source-ns-2 argocd.argoproj.io/managed-by=test-1-046-argocd-2
8+
sleep 30
9+
# Set tracking-id labels
10+
- script: |
11+
kubectl label ns source-ns-1 argocd.argoproj.io/tracking-id=instance-1
12+
kubectl label ns source-ns-2 argocd.argoproj.io/tracking-id=instance-2
13+
sleep 30
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestAssert
3+
timeout: 300
4+
---
5+
# Check first Application is healthy
6+
apiVersion: argoproj.io/v1alpha1
7+
kind: Application
8+
metadata:
9+
name: test-app
10+
namespace: test-1-046-argocd-1
11+
status:
12+
health:
13+
status: Healthy
14+
sync:
15+
status: Synced
16+
---
17+
# Check second Application is healthy
18+
apiVersion: argoproj.io/v1alpha1
19+
kind: Application
20+
metadata:
21+
name: test-app
22+
namespace: test-1-046-argocd-2
23+
status:
24+
health:
25+
status: Healthy
26+
sync:
27+
status: Synced

tests/k8s/1-046_validate_application_tracking/02-create-apps.yaml renamed to tests/k8s/1-046_validate_application_tracking/03-create-apps.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This creates an application with a destination in the other managed namespace
1+
# Application in first ArgoCD instance
22
apiVersion: argoproj.io/v1alpha1
33
kind: Application
44
metadata:
@@ -9,13 +9,14 @@ spec:
99
source:
1010
repoURL: https://github.com/redhat-developer/gitops-operator
1111
path: test/examples/nginx
12-
targetRevision: "HEAD"
12+
targetRevision: HEAD
1313
destination:
14-
server: "https://kubernetes.default.svc"
14+
server: https://kubernetes.default.svc
1515
namespace: source-ns-1
1616
syncPolicy:
1717
automated: {}
1818
---
19+
# Application in second ArgoCD instance
1920
apiVersion: argoproj.io/v1alpha1
2021
kind: Application
2122
metadata:
@@ -26,9 +27,9 @@ spec:
2627
source:
2728
repoURL: https://github.com/redhat-developer/gitops-operator
2829
path: test/examples/nginx
29-
targetRevision: "HEAD"
30+
targetRevision: HEAD
3031
destination:
31-
server: "https://kubernetes.default.svc"
32+
server: https://kubernetes.default.svc
3233
namespace: source-ns-2
3334
syncPolicy:
3435
automated: {}

0 commit comments

Comments
 (0)