File tree Expand file tree Collapse file tree 3 files changed +16
-67
lines changed Expand file tree Collapse file tree 3 files changed +16
-67
lines changed Original file line number Diff line number Diff line change @@ -452,7 +452,7 @@ func TestValidateGateway(t *testing.T) {
452
452
},
453
453
}
454
454
},
455
- wantErrors : []string {"Invalid value: \" 1.2.3.4:8080\" : spec .addresses[0].value in body must be of type ipv4" },
455
+ wantErrors : []string {"Invalid value: \" 1.2.3.4:8080\" : status .addresses[0].value in body must be of type ipv4" },
456
456
},
457
457
{
458
458
desc : "duplicate ip address or hostname" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -35,15 +35,15 @@ cleanup() {
35
35
return
36
36
fi
37
37
38
- rm config/webhook/kustomization.yaml
38
+ rm -f config/webhook/kustomization.yaml
39
39
40
40
if [ " ${KIND_CREATE_ATTEMPTED:- } " = true ]; then
41
41
kind delete cluster --name " ${CLUSTER_NAME} " || true
42
42
fi
43
43
CLEANED_UP=true
44
44
}
45
45
46
- trap cleanup INT TERM
46
+ trap cleanup INT TERM EXIT
47
47
48
48
# For exit code
49
49
res=0
53
53
54
54
# Create cluster
55
55
KIND_CREATE_ATTEMPTED=true
56
- kind create cluster --name " ${CLUSTER_NAME} " || res=$?
56
+ kind create cluster --name " ${CLUSTER_NAME} "
57
+
58
+ # Verify CEL validations before installing webhook.
59
+ for CHANNEL in experimental standard; do
60
+ # Install CRDs.
61
+ kubectl apply -f " config/crd/${CHANNEL} /gateway*.yaml"
62
+
63
+ # Run tests.
64
+ go test -timeout=120s -count=1 sigs.k8s.io/gateway-api/hack/cel-validation
65
+
66
+ # Delete CRDs to reset environment.
67
+ kubectl delete -f " config/crd/${CHANNEL} /gateway*.yaml"
68
+ done
57
69
58
70
cat << EOF >config/webhook/kustomization.yaml
59
71
resources:
You can’t perform that action at this time.
0 commit comments