Skip to content

Commit 6f796d7

Browse files
committed
resolve comments
1 parent 00a8c6f commit 6f796d7

File tree

3 files changed

+21
-42
lines changed

3 files changed

+21
-42
lines changed

api/v1alpha1/httproutepolicy_types.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ type HTTPRoutePolicySpec struct {
3636
// +kubebuilder:validation:MaxItems=16
3737
TargetRefs []gatewayv1alpha2.LocalPolicyTargetReferenceWithSectionName `json:"targetRefs"`
3838

39-
Policy HTTPRoutePolicySpecPolicy `json:"policy"`
39+
Priority *int64 `json:"priority,omitempty" yaml:"priority,omitempty"`
40+
Vars Vars `json:"vars,omitempty" yaml:"vars,omitempty"`
4041
}
4142

4243
// +kubebuilder:object:root=true
44+
// +kubebuilder:subresource:status
4345

4446
// HTTPRoutePolicy is the Schema for the httproutepolicies API.
4547
type HTTPRoutePolicy struct {
@@ -59,11 +61,6 @@ type HTTPRoutePolicyList struct {
5961
Items []HTTPRoutePolicy `json:"items"`
6062
}
6163

62-
type HTTPRoutePolicySpecPolicy struct {
63-
Priority *int64 `json:"priority,omitempty" yaml:"priority,omitempty"`
64-
Vars Vars `json:"vars,omitempty" yaml:"vars,omitempty"`
65-
}
66-
6764
// Vars represents the route match expressions of APISIX.
6865
// +kubebuilder:object:generate=false
6966
type Vars = common.Vars

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/gateway.apisix.io_httproutepolicies.yaml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,9 @@ spec:
3939
spec:
4040
description: HTTPRoutePolicySpec defines the desired state of HTTPRoutePolicy.
4141
properties:
42-
policy:
43-
properties:
44-
priority:
45-
format: int64
46-
type: integer
47-
vars:
48-
description: Vars represents the route match expressions of APISIX.
49-
items:
50-
items:
51-
description: |-
52-
StringOrSlice represents a string or a string slice.
53-
TODO Do not use interface{} to avoid the reflection overheads.
54-
type: object
55-
type: array
56-
type: array
57-
type: object
42+
priority:
43+
format: int64
44+
type: integer
5845
targetRefs:
5946
description: |-
6047
TargetRef identifies an API object (enum: HTTPRoute, Ingress) to apply HTTPRoutePolicy to.
@@ -122,8 +109,17 @@ spec:
122109
- kind
123110
- name
124111
x-kubernetes-list-type: map
112+
vars:
113+
description: Vars represents the route match expressions of APISIX.
114+
items:
115+
items:
116+
description: |-
117+
StringOrSlice represents a string or a string slice.
118+
TODO Do not use interface{} to avoid the reflection overheads.
119+
type: object
120+
type: array
121+
type: array
125122
required:
126-
- policy
127123
- targetRefs
128124
type: object
129125
status:
@@ -474,3 +470,5 @@ spec:
474470
type: object
475471
served: true
476472
storage: true
473+
subresources:
474+
status: {}

0 commit comments

Comments
 (0)