File tree Expand file tree Collapse file tree 4 files changed +74
-17
lines changed
tests/k8s/1-046_validate_application_tracking Expand file tree Collapse file tree 4 files changed +74
-17
lines changed Original file line number Diff line number Diff line change 1
1
apiVersion: kuttl.dev/v1beta1
2
2
kind: TestAssert
3
- metadata:
4
- name: assert-apps
5
3
timeout: 300
6
4
---
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
10
26
metadata:
11
- name: test-app
12
- namespace: test-1-046-argocd -1
27
+ name: argocd-1-argocd-application-controller
28
+ namespace: source-ns -1
13
29
---
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
17
33
metadata:
18
- name: test-app
19
- namespace: test-1-046-argocd -2
34
+ name: argocd-2-argocd-application-controller
35
+ namespace: source-ns -2
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 1
- # This creates an application with a destination in the other managed namespace
1
+ # Application in first ArgoCD instance
2
2
apiVersion: argoproj.io/v1alpha1
3
3
kind: Application
4
4
metadata:
9
9
source:
10
10
repoURL: https://github.com/redhat-developer/gitops-operator
11
11
path: test/examples/nginx
12
- targetRevision: " HEAD"
12
+ targetRevision: HEAD
13
13
destination:
14
- server: " https://kubernetes.default.svc"
14
+ server: https://kubernetes.default.svc
15
15
namespace: source-ns-1
16
16
syncPolicy:
17
17
automated: {}
18
18
---
19
+ # Application in second ArgoCD instance
19
20
apiVersion: argoproj.io/v1alpha1
20
21
kind: Application
21
22
metadata:
26
27
source:
27
28
repoURL: https://github.com/redhat-developer/gitops-operator
28
29
path: test/examples/nginx
29
- targetRevision: " HEAD"
30
+ targetRevision: HEAD
30
31
destination:
31
- server: " https://kubernetes.default.svc"
32
+ server: https://kubernetes.default.svc
32
33
namespace: source-ns-2
33
34
syncPolicy:
34
35
automated: {}
You can’t perform that action at this time.
0 commit comments