Skip to content

Commit

Permalink
Gateway API: add support for ReferenceGrant (#4580)
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 authored Jun 16, 2022
1 parent 485238e commit c74c33a
Show file tree
Hide file tree
Showing 17 changed files with 156 additions and 93 deletions.
5 changes: 5 additions & 0 deletions changelogs/unreleased/4580-skriss-deprecation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Gateway API: ReferencePolicy is deprecated, will be removed next release

Gateway API has renamed ReferencePolicy to ReferenceGrant in the v0.5.0 release, while retaining the former for one release to ease migration.
Contour currently supports both, but will drop support for ReferencePolicy in the next release.
Users of ReferencePolicies must migrate their resources to ReferenceGrants ahead of the next Contour release.
1 change: 1 addition & 0 deletions changelogs/unreleased/4580-skriss-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gateway API: adds support for ReferenceGrant, which was formerly known as ReferencePolicy. To ease migration, _both_ resources are supported for this release, but ReferencePolicy support will be removed next release.
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 c74c33a

Please sign in to comment.