Skip to content

Commit

Permalink
PolicyType as a scalar
Browse files Browse the repository at this point in the history
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed Nov 11, 2022
1 parent caa275a commit fa7282d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
21 changes: 4 additions & 17 deletions examples/gateway/00-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4975,23 +4975,7 @@ spec:
items:
properties:
policyType:
description: PolicyGroupKind indicates the group and kind
of a Policy resource.
properties:
group:
description: Group is the group of the Policy.
maxLength: 253
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
kind:
description: Kind is the kind of the Route.
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
type: string
required:
- kind
type: object
type: string
policyValue:
type: string
sectionName:
Expand All @@ -5011,6 +4995,9 @@ spec:
- sectionName
type: object
type: array
x-kubernetes-list-map-keys:
- policyType
x-kubernetes-list-type: map
parentRef:
description: ParentRef corresponds with a ParentRef in the spec
that this RouteParentStatus struct describes the status of.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ require (
sigs.k8s.io/kustomize/kyaml v0.10.17
)

replace sigs.k8s.io/gateway-api => github.com/sunjayBhatia/gateway-api v0.0.0-20221107210021-3a96f4e00fc9
replace sigs.k8s.io/gateway-api => github.com/sunjayBhatia/gateway-api v0.0.0-20221111001054-0cf3fa56af68
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,8 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/sunjayBhatia/gateway-api v0.0.0-20221107210021-3a96f4e00fc9 h1:1FmGVOLRLTB8eji9Gd9UlKca7F0FCfP/lfOAVfuZhIs=
github.com/sunjayBhatia/gateway-api v0.0.0-20221107210021-3a96f4e00fc9/go.mod h1:x0AP6gugkFV8fC/oTlnOMU0pnmuzIR8LfIPRVUjxSqA=
github.com/sunjayBhatia/gateway-api v0.0.0-20221111001054-0cf3fa56af68 h1:VXb1UC0933STso1KO/97s6ZOzsxqtedK7eH8Rwd4kIg=
github.com/sunjayBhatia/gateway-api v0.0.0-20221111001054-0cf3fa56af68/go.mod h1:x0AP6gugkFV8fC/oTlnOMU0pnmuzIR8LfIPRVUjxSqA=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
Expand Down
5 changes: 1 addition & 4 deletions internal/dag/gatewayapi_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1174,10 +1174,7 @@ func (p *GatewayAPIProcessor) computeHTTPRoute(route *gatewayapi_v1beta1.HTTPRou
// Add EffectivePolicyConfiguration to Status.
policyContent, _ := json.Marshal(finalLocalRLP)
routeAccessor.AddEffectivePolicyConfig(gatewayapi_v1beta1.RouteEffectivePolicyConfiguration{
PolicyType: gatewayapi_v1beta1.PolicyGroupKind{
Group: gatewayapi_v1beta1.Group(contour_api_v1alpha1.RateLimitPolicyGVR.Group),
Kind: gatewayapi_v1beta1.Kind("RateLimitPolicy"),
},
PolicyType: "projectcontour.io/RateLimitPolicy",
SectionName: gatewayapi_v1beta1.SectionName("unsupportedfornow"),
PolicyValue: string(policyContent),
})
Expand Down

0 comments on commit fa7282d

Please sign in to comment.