Skip to content

Commit 016442d

Browse files
authored
Merge pull request #45 from datum-cloud/fix-e2e-tests
fix: Remove e2e test for domains, fix gateway e2e test
2 parents 1ac60b0 + 4a30011 commit 016442d

5 files changed

Lines changed: 45 additions & 117 deletions

File tree

PROJECT

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,13 @@ resources:
9797
kind: HTTPProxy
9898
path: go.datum.net/network-services-operator/api/v1alpha
9999
version: v1alpha
100+
- api:
101+
crdVersion: v1
102+
namespaced: true
103+
controller: true
104+
domain: datumapis.com
105+
group: networking
106+
kind: Domain
107+
path: go.datum.net/network-services-operator/api/v1alpha
108+
version: v1alpha
100109
version: "3"

config/rbac/role.yaml

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,6 @@ rules:
3838
- get
3939
- patch
4040
- update
41-
- apiGroups:
42-
- datumapis.com
43-
resources:
44-
- domains
45-
verbs:
46-
- create
47-
- delete
48-
- get
49-
- list
50-
- patch
51-
- update
52-
- watch
53-
- apiGroups:
54-
- datumapis.com
55-
resources:
56-
- domains/finalizers
57-
verbs:
58-
- update
59-
- apiGroups:
60-
- datumapis.com
61-
resources:
62-
- domains/status
63-
verbs:
64-
- get
65-
- patch
66-
- update
6741
- apiGroups:
6842
- discovery.k8s.io
6943
resources:
@@ -154,6 +128,7 @@ rules:
154128
- apiGroups:
155129
- networking.datumapis.com
156130
resources:
131+
- domains
157132
- httpproxies
158133
- networkbindings
159134
- networkcontexts
@@ -172,6 +147,7 @@ rules:
172147
- apiGroups:
173148
- networking.datumapis.com
174149
resources:
150+
- domains/finalizers
175151
- httpproxies/finalizers
176152
- networkbindings/finalizers
177153
- networkcontexts/finalizers
@@ -184,6 +160,7 @@ rules:
184160
- apiGroups:
185161
- networking.datumapis.com
186162
resources:
163+
- domains/status
187164
- httpproxies/status
188165
- networkbindings/status
189166
- networkcontexts/status

internal/controller/domain_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ type DomainReconciler struct {
4141
lookupTXT func(ctx context.Context, name string) ([]string, error)
4242
}
4343

44-
// +kubebuilder:rbac:groups=datumapis.com,resources=domains,verbs=get;list;watch;create;update;patch;delete
45-
// +kubebuilder:rbac:groups=datumapis.com,resources=domains/status,verbs=get;update;patch
46-
// +kubebuilder:rbac:groups=datumapis.com,resources=domains/finalizers,verbs=update
44+
// +kubebuilder:rbac:groups=networking.datumapis.com,resources=domains,verbs=get;list;watch;create;update;patch;delete
45+
// +kubebuilder:rbac:groups=networking.datumapis.com,resources=domains/status,verbs=get;update;patch
46+
// +kubebuilder:rbac:groups=networking.datumapis.com,resources=domains/finalizers,verbs=update
4747

4848
// Reconcile is part of the main kubernetes reconciliation loop which aims to
4949
// move the current state of the cluster closer to the desired state.

test/e2e/domain/chainsaw-test.yaml

Lines changed: 0 additions & 88 deletions
This file was deleted.

test/e2e/gateway/chainsaw-test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ spec:
138138
name: custom-proxy-config
139139
namespace: envoy-gateway-system
140140

141+
- description: Create namespace for hostname tracking
142+
apply:
143+
cluster: nso-infra
144+
resource:
145+
apiVersion: v1
146+
kind: Namespace
147+
metadata:
148+
name: datum-downstream-gateway-hostnames
149+
141150
- name: Create pod and service to serve as a backend for the HTTPRoute
142151
try:
143152
- create:
@@ -233,6 +242,27 @@ spec:
233242
selector:
234243
purpose: backend-pod
235244

245+
- name: Provision Domain
246+
try:
247+
- create:
248+
cluster: nso-standard
249+
resource:
250+
apiVersion: networking.datumapis.com/v1alpha
251+
kind: Domain
252+
metadata:
253+
name: test-domain
254+
spec:
255+
domainName: e2e.env.datum.net
256+
257+
- description: |
258+
Under normal operation, the Domain controller will perform verification
259+
via HTTP or DNS, and update the Domain's status.
260+
script:
261+
content: |
262+
kubectl -n $NAMESPACE patch domain test-domain \
263+
--subresource=status --type=merge \
264+
-p '{"status":{"conditions":[{"type": "Verified", "status": "True", "reason": "Test", "message": "test", "lastTransitionTime": "2025-02-24T23:59:09Z"}]}}'
265+
236266
- name: Provision Gateway
237267
try:
238268
# Get the target namespace UID

0 commit comments

Comments
 (0)