Skip to content

Commit 36b649c

Browse files
authored
feat: enhance toolhive k8s e2e tests with multi-tenant tests (#1029)
Signed-off-by: ChrisJBurns <[email protected]>
1 parent 73b5e7c commit 36b649c

File tree

73 files changed

+1457
-85
lines changed

Some content is hidden

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

73 files changed

+1457
-85
lines changed

.github/workflows/operator-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ jobs:
156156
# but we want to make sure renovate bumps the versions when new ones are released. Doing that with
157157
# just the number is a bit more difficult and i like simple things.
158158
version: [
159-
"kindest/node:v1.30.13",
160159
"kindest/node:v1.31.9",
161160
"kindest/node:v1.32.5",
162161
"kindest/node:v1.33.1"
@@ -198,12 +197,16 @@ jobs:
198197
with:
199198
cluster_name: toolhive
200199
version: v0.29.0
200+
cloud_provider: true
201201
node_image: ${{ matrix.version }}
202202

203203
- name: Run Chainsaw tests
204204
run: |
205205
kind get kubeconfig --name toolhive > kconfig.yaml
206206
export KUBECONFIG=kconfig.yaml
207-
chainsaw test --test-dir test/e2e/chainsaw/operator/setup --config .chainsaw.yaml
208-
chainsaw test --test-dir test/e2e/chainsaw/operator/test-scenarios --config .chainsaw.yaml
209-
chainsaw test --test-dir test/e2e/chainsaw/operator/cleanup --config .chainsaw.yaml
207+
chainsaw test --test-dir test/e2e/chainsaw/operator/multi-tenancy/setup --config .chainsaw.yaml
208+
chainsaw test --test-dir test/e2e/chainsaw/operator/multi-tenancy/test-scenarios --config .chainsaw.yaml
209+
chainsaw test --test-dir test/e2e/chainsaw/operator/multi-tenancy/cleanup --config .chainsaw.yaml
210+
chainsaw test --test-dir test/e2e/chainsaw/operator/single-tenancy/setup --config .chainsaw.yaml
211+
chainsaw test --test-dir test/e2e/chainsaw/operator/single-tenancy/test-scenarios --config .chainsaw.yaml
212+
chainsaw test --test-dir test/e2e/chainsaw/operator/single-tenancy/cleanup --config .chainsaw.yaml

cmd/thv-operator/Taskfile.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ tasks:
111111
--set operator.toolhiveRunnerImage={{.TOOLHIVE_IMAGE}} \
112112
--namespace toolhive-system \
113113
--create-namespace \
114-
--kubeconfig kconfig.yaml
114+
--kubeconfig kconfig.yaml \
115+
{{ .CLI_ARGS }}
115116
116117
operator-undeploy:
117118
desc: Undeploy operator from the K8s cluster
@@ -143,9 +144,12 @@ tasks:
143144
operator-e2e-test:
144145
desc: Run E2E tests for the operator
145146
cmds:
146-
- chainsaw test --test-dir test/e2e/chainsaw/operator/setup
147-
- chainsaw test --test-dir test/e2e/chainsaw/operator/test-scenarios
148-
- chainsaw test --test-dir test/e2e/chainsaw/operator/cleanup
147+
- chainsaw test --test-dir test/e2e/chainsaw/operator/multi-tenancy/setup
148+
- chainsaw test --test-dir test/e2e/chainsaw/operator/multi-tenancy/test-scenarios
149+
- chainsaw test --test-dir test/e2e/chainsaw/operator/multi-tenancy/cleanup
150+
- chainsaw test --test-dir test/e2e/chainsaw/operator/single-tenancy/setup
151+
- chainsaw test --test-dir test/e2e/chainsaw/operator/single-tenancy/test-scenarios
152+
- chainsaw test --test-dir test/e2e/chainsaw/operator/single-tenancy/cleanup
149153

150154
crdref-install:
151155
desc: Install elastic/crd-ref-docs
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: toolhive-operator-manager-role
6+
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- configmaps
11+
- services
12+
verbs:
13+
- create
14+
- delete
15+
- get
16+
- list
17+
- patch
18+
- update
19+
- watch
20+
- apiGroups:
21+
- "rbac.authorization.k8s.io"
22+
resources:
23+
- roles
24+
- rolebindings
25+
verbs:
26+
- create
27+
- delete
28+
- get
29+
- list
30+
- patch
31+
- update
32+
- watch
33+
- apiGroups:
34+
- ""
35+
resources:
36+
- events
37+
verbs:
38+
- create
39+
- patch
40+
- apiGroups:
41+
- ""
42+
resources:
43+
- pods
44+
- secrets
45+
verbs:
46+
- get
47+
- list
48+
- watch
49+
- apiGroups:
50+
- apps
51+
resources:
52+
- deployments
53+
verbs:
54+
- create
55+
- delete
56+
- get
57+
- list
58+
- patch
59+
- update
60+
- watch
61+
- apiGroups:
62+
- toolhive.stacklok.dev
63+
resources:
64+
- mcpservers
65+
verbs:
66+
- create
67+
- delete
68+
- get
69+
- list
70+
- patch
71+
- update
72+
- watch
73+
- apiGroups:
74+
- toolhive.stacklok.dev
75+
resources:
76+
- mcpservers/finalizers
77+
verbs:
78+
- update
79+
- apiGroups:
80+
- toolhive.stacklok.dev
81+
resources:
82+
- mcpservers/status
83+
verbs:
84+
- get
85+
- patch
86+
- update
87+
- apiGroups:
88+
- ""
89+
resources:
90+
- serviceaccounts
91+
verbs:
92+
- create
93+
- delete
94+
- get
95+
- list
96+
- patch
97+
- update
98+
- watch
99+
- apiGroups:
100+
- "apps"
101+
resources:
102+
- statefulsets
103+
verbs:
104+
- get
105+
- list
106+
- watch
107+
- create
108+
- update
109+
- patch
110+
- delete
111+
- apply
112+
- apiGroups:
113+
- ""
114+
resources:
115+
- services
116+
verbs:
117+
- get
118+
- list
119+
- watch
120+
- create
121+
- update
122+
- patch
123+
- delete
124+
- apply
125+
- apiGroups:
126+
- ""
127+
resources:
128+
- pods
129+
verbs:
130+
- get
131+
- list
132+
- watch
133+
- apiGroups:
134+
- ""
135+
resources:
136+
- pods/attach
137+
verbs:
138+
- create
139+
- get
140+
- apiGroups:
141+
- ""
142+
resources:
143+
- pods/log
144+
verbs:
145+
- get
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: RoleBinding
3+
metadata:
4+
name: toolhive-operator-manager-rolebinding
5+
namespace: test-namespace
6+
subjects:
7+
- kind: ServiceAccount
8+
name: toolhive-operator
9+
namespace: toolhive-system
10+
roleRef:
11+
apiGroup: rbac.authorization.k8s.io
12+
kind: ClusterRole
13+
name: toolhive-operator-manager-role
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: RoleBinding
3+
metadata:
4+
name: toolhive-operator-manager-rolebinding
5+
namespace: toolhive-system
6+
subjects:
7+
- kind: ServiceAccount
8+
name: toolhive-operator
9+
namespace: toolhive-system
10+
roleRef:
11+
apiGroup: rbac.authorization.k8s.io
12+
kind: ClusterRole
13+
name: toolhive-operator-manager-role

0 commit comments

Comments
 (0)