Skip to content

Commit

Permalink
Gateway API: add support for ReferenceGrant
Browse files Browse the repository at this point in the history
Adds support for the renamed ReferenceGrant
resource while retaining support for
ReferencePolicy, to allow for a seamless
migration. ReferencePolicy support will
be removed in a subsequent release.

Updates #4555.

Signed-off-by: Steve Kriss <krisss@vmware.com>
  • Loading branch information
skriss committed Jun 15, 2022
1 parent 80ce8ce commit 807619a
Show file tree
Hide file tree
Showing 15 changed files with 150 additions and 93 deletions.
5 changes: 5 additions & 0 deletions cmd/contour/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,11 @@ func (s *Server) setupGatewayAPI(contourConfiguration contour_api_v1alpha1.Conto
s.log.WithError(err).WithField("resource", "referencepolicies").Fatal("failed to create informer")
}

// Inform on ReferenceGrants.
if err := informOnResource(&gatewayapi_v1alpha2.ReferenceGrant{}, eventHandler, mgr.GetCache()); err != nil {
s.log.WithError(err).WithField("resource", "referencegrants").Fatal("failed to create informer")
}

// Inform on Namespaces.
if err := informOnResource(&corev1.Namespace{}, eventHandler, mgr.GetCache()); err != nil {
s.log.WithError(err).WithField("resource", "namespaces").Fatal("failed to create informer")
Expand Down
1 change: 1 addition & 0 deletions examples/contour/02-role-contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ rules:
- gatewayclasses
- gateways
- httproutes
- referencegrants
- referencepolicies
- tlsroutes
verbs:
Expand Down
1 change: 1 addition & 0 deletions examples/gateway-provisioner/01-roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ rules:
- gatewayclasses
- gateways
- httproutes
- referencegrants
- referencepolicies
- tlsroutes
verbs:
Expand Down
1 change: 1 addition & 0 deletions examples/render/contour-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4852,6 +4852,7 @@ rules:
- gatewayclasses
- gateways
- httproutes
- referencegrants
- referencepolicies
- tlsroutes
verbs:
Expand Down
1 change: 1 addition & 0 deletions examples/render/contour-gateway-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11626,6 +11626,7 @@ rules:
- gatewayclasses
- gateways
- httproutes
- referencegrants
- referencepolicies
- tlsroutes
verbs:
Expand Down
1 change: 1 addition & 0 deletions examples/render/contour-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4857,6 +4857,7 @@ rules:
- gatewayclasses
- gateways
- httproutes
- referencegrants
- referencepolicies
- tlsroutes
verbs:
Expand Down
1 change: 1 addition & 0 deletions examples/render/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4852,6 +4852,7 @@ rules:
- gatewayclasses
- gateways
- httproutes
- referencegrants
- referencepolicies
- tlsroutes
verbs:
Expand Down
Loading

0 comments on commit 807619a

Please sign in to comment.