Skip to content

Commit 36d1045

Browse files
committed
chore: Add CRD HTTPRoutePolicy
1 parent b50f98e commit 36d1045

File tree

7 files changed

+188
-1
lines changed

7 files changed

+188
-1
lines changed

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,12 @@ resources:
2626
kind: GatewayProxy
2727
path: github.com/api7/api7-ingress-controller/api/v1alpha1
2828
version: v1alpha1
29+
- api:
30+
crdVersion: v1
31+
namespaced: true
32+
domain: github.com
33+
group: gateway.apisix.io
34+
kind: HTTPRoutePolicy
35+
path: github.com/api7/api7-ingress-controller/api/v1alpha1
36+
version: v1alpha1
2937
version: "3"

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 161 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- bases/gateway.apisix.io_gatewayproxies.yaml
77
- bases/gateway.apisix.io_consumers.yaml
88
- bases/gateway.apisix.io_backendtrafficpolicies.yaml
9+
- bases/gateway.apisix.io_httproutepolicies.yaml
910
# +kubebuilder:scaffold:crdkustomizeresource
1011

1112
patches:

config/rbac/kustomization.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ resources:
1818
- metrics_auth_role.yaml
1919
- metrics_auth_role_binding.yaml
2020
- metrics_reader_role.yaml
21+
# For each CRD, "Admin", "Editor" and "Viewer" roles are scaffolded by
22+
# default, aiding admins in cluster management. Those roles are
23+
# not used by the {{ .ProjectName }} itself. You can comment the following lines
24+
# if you do not want those helpers be installed with your Project.
25+
- httproutepolicy_admin_role.yaml
26+
- httproutepolicy_editor_role.yaml
27+
- httproutepolicy_viewer_role.yaml
28+

config/rbac/role.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ rules:
9393
- get
9494
- list
9595
- watch
96+
- apiGroups:
97+
- gateway.apisix.io
98+
resources:
99+
- httproutepolicies
100+
verbs:
101+
- get
102+
- list
103+
- watch
96104
- apiGroups:
97105
- gateway.apisix.io
98106
resources:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ require (
2929
go.uber.org/zap v1.27.0
3030
golang.org/x/net v0.28.0
3131
gopkg.in/yaml.v2 v2.4.0
32-
gopkg.in/yaml.v3 v3.0.1
3332
gorm.io/gorm v1.25.11
3433
helm.sh/helm/v3 v3.15.4
3534
k8s.io/api v0.31.1
@@ -213,6 +212,7 @@ require (
213212
gopkg.in/fsnotify.v1 v1.4.7 // indirect
214213
gopkg.in/inf.v0 v0.9.1 // indirect
215214
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
215+
gopkg.in/yaml.v3 v3.0.1 // indirect
216216
k8s.io/apiserver v0.31.1 // indirect
217217
k8s.io/cli-runtime v0.30.3 // indirect
218218
k8s.io/component-base v0.31.1 // indirect

internal/manager/controllers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
// +kubebuilder:rbac:groups=gateway.apisix.io,resources=consumers/status,verbs=get;update
2727
// +kubebuilder:rbac:groups=gateway.apisix.io,resources=backendtrafficpolicies,verbs=get;list;watch
2828
// +kubebuilder:rbac:groups=gateway.apisix.io,resources=backendtrafficpolicies/status,verbs=get;update
29+
// +kubebuilder:rbac:groups=gateway.apisix.io,resources=httproutepolicies,verbs=get;list;watch
2930

3031
// GatewayAPI
3132
// +kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=gatewayclasses,verbs=get;list;watch;update

0 commit comments

Comments
 (0)