Skip to content

Commit 2dc0939

Browse files
author
Per Goncalves da Silva
committed
add convert regression testing
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent d3aec37 commit 2dc0939

File tree

55 files changed

+90085
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+90085
-0
lines changed

Diff for: Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyI
154154
verify: tidy fmt generate manifests crd-ref-docs #HELP Verify all generated code is up-to-date.
155155
git diff --exit-code
156156

157+
.PHONY: verify-convert
158+
verify-convert:
159+
go run test/convert/generate-manifests.go
160+
git diff --exit-code
161+
157162
.PHONY: fix-lint
158163
fix-lint: $(GOLANGCI_LINT) #EXHELP Fix lint issues
159164
$(GOLANGCI_LINT) run --fix --build-tags $(GO_BUILD_TAGS) $(GOLANGCI_LINT_ARGS)

Diff for: test/convert/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## registry+v1 bundle generation regression tests
2+
3+
This directory includes test cases for the rukpak/convert package based on real bundle data.
4+
The manifests are generated and manually/visually verified for correctness.
5+
6+
The `generate-manifests.go` tool is used to generate the tests cases by calling convert.Convert on bundles
7+
in the `testdata` directory.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
creationTimestamp: null
5+
name: argocd-operator-controller-manager
6+
namespace: argocd-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
creationTimestamp: null
5+
name: argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- configmaps
11+
- endpoints
12+
- events
13+
- namespaces
14+
- persistentvolumeclaims
15+
- pods
16+
- secrets
17+
- serviceaccounts
18+
- services
19+
- services/finalizers
20+
verbs:
21+
- '*'
22+
- apiGroups:
23+
- ""
24+
resources:
25+
- pods
26+
- pods/log
27+
verbs:
28+
- get
29+
- apiGroups:
30+
- apps
31+
resources:
32+
- daemonsets
33+
- deployments
34+
- replicasets
35+
- statefulsets
36+
verbs:
37+
- '*'
38+
- apiGroups:
39+
- apps
40+
resourceNames:
41+
- argocd-operator
42+
resources:
43+
- deployments/finalizers
44+
verbs:
45+
- update
46+
- apiGroups:
47+
- apps.openshift.io
48+
resources:
49+
- deploymentconfigs
50+
verbs:
51+
- '*'
52+
- apiGroups:
53+
- argoproj.io
54+
resources:
55+
- applications
56+
- appprojects
57+
verbs:
58+
- '*'
59+
- apiGroups:
60+
- argoproj.io
61+
resources:
62+
- argocdexports
63+
- argocdexports/finalizers
64+
- argocdexports/status
65+
verbs:
66+
- '*'
67+
- apiGroups:
68+
- argoproj.io
69+
resources:
70+
- argocds
71+
- argocds/finalizers
72+
- argocds/status
73+
verbs:
74+
- '*'
75+
- apiGroups:
76+
- autoscaling
77+
resources:
78+
- horizontalpodautoscalers
79+
verbs:
80+
- '*'
81+
- apiGroups:
82+
- batch
83+
resources:
84+
- cronjobs
85+
- jobs
86+
verbs:
87+
- '*'
88+
- apiGroups:
89+
- config.openshift.io
90+
resources:
91+
- clusterversions
92+
verbs:
93+
- get
94+
- list
95+
- watch
96+
- apiGroups:
97+
- monitoring.coreos.com
98+
resources:
99+
- prometheuses
100+
- servicemonitors
101+
verbs:
102+
- '*'
103+
- apiGroups:
104+
- networking.k8s.io
105+
resources:
106+
- ingresses
107+
verbs:
108+
- '*'
109+
- apiGroups:
110+
- oauth.openshift.io
111+
resources:
112+
- oauthclients
113+
verbs:
114+
- create
115+
- delete
116+
- get
117+
- list
118+
- patch
119+
- update
120+
- watch
121+
- apiGroups:
122+
- rbac.authorization.k8s.io
123+
resources:
124+
- '*'
125+
verbs:
126+
- '*'
127+
- apiGroups:
128+
- rbac.authorization.k8s.io
129+
resources:
130+
- clusterrolebindings
131+
- clusterroles
132+
verbs:
133+
- '*'
134+
- apiGroups:
135+
- route.openshift.io
136+
resources:
137+
- routes
138+
- routes/custom-host
139+
verbs:
140+
- '*'
141+
- apiGroups:
142+
- template.openshift.io
143+
resources:
144+
- templateconfigs
145+
- templateinstances
146+
- templates
147+
verbs:
148+
- '*'
149+
- apiGroups:
150+
- authentication.k8s.io
151+
resources:
152+
- tokenreviews
153+
verbs:
154+
- create
155+
- apiGroups:
156+
- authorization.k8s.io
157+
resources:
158+
- subjectaccessreviews
159+
verbs:
160+
- create
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
creationTimestamp: null
5+
name: argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- configmaps
11+
verbs:
12+
- get
13+
- list
14+
- watch
15+
- create
16+
- update
17+
- patch
18+
- delete
19+
- apiGroups:
20+
- coordination.k8s.io
21+
resources:
22+
- leases
23+
verbs:
24+
- get
25+
- list
26+
- watch
27+
- create
28+
- update
29+
- patch
30+
- delete
31+
- apiGroups:
32+
- ""
33+
resources:
34+
- events
35+
verbs:
36+
- create
37+
- patch
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
creationTimestamp: null
5+
name: argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx
6+
roleRef:
7+
apiGroup: rbac.authorization.k8s.io
8+
kind: ClusterRole
9+
name: argocd-operator.v0-1dhiybrldl1gyksid1dk2dqjsc72psdybc7iyvse5gpx
10+
subjects:
11+
- kind: ServiceAccount
12+
name: argocd-operator-controller-manager
13+
namespace: argocd-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
creationTimestamp: null
5+
name: argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3
6+
roleRef:
7+
apiGroup: rbac.authorization.k8s.io
8+
kind: ClusterRole
9+
name: argocd-operator.v0-22gmilmgp91wu25is5i2ec598hni8owq3l71bbkl7iz3
10+
subjects:
11+
- kind: ServiceAccount
12+
name: argocd-operator-controller-manager
13+
namespace: argocd-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
creationTimestamp: null
5+
labels:
6+
control-plane: controller-manager
7+
name: argocd-operator-controller-manager-metrics-service
8+
namespace: argocd-system
9+
spec:
10+
ports:
11+
- name: https
12+
port: 8443
13+
targetPort: https
14+
selector:
15+
control-plane: controller-manager
16+
status:
17+
loadBalancer: {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
data:
3+
controller_manager_config.yaml: |
4+
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
5+
kind: ControllerManagerConfig
6+
health:
7+
healthProbeBindAddress: :8081
8+
metrics:
9+
bindAddress: 127.0.0.1:8080
10+
webhook:
11+
port: 9443
12+
leaderElection:
13+
leaderElect: true
14+
resourceName: b674928d.argoproj.io
15+
kind: ConfigMap
16+
metadata:
17+
name: argocd-operator-manager-config
18+
namespace: argocd-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
creationTimestamp: null
5+
name: argocd-operator-metrics-reader
6+
rules:
7+
- nonResourceURLs:
8+
- /metrics
9+
verbs:
10+
- get

0 commit comments

Comments
 (0)