Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReferenceGrant Support for Routes #793

Merged
merged 1 commit into from
Dec 17, 2022
Merged

Conversation

danehans
Copy link
Contributor

@danehans danehans commented Dec 9, 2022

Previously, a route, e.g. HTTPRoute, could not reference a backend in a different namespace due to validateBackendRef() returning an error if a BackendRef included the namespace field.

  • Updates Reconcile() to only add a RefereneGrant to the resource tree if the RefereneGrant can be found and only return an error if an error was received when listing RefereneGrants.
  • Updates Reconcile() to only add s Service to the resource tree if the Service can be found and only return an error if an error was received when Getting the Service.
  • Updates validateBackendRef() to no longer return an error if the namespace field is set for a backendRef.
  • Adds the HTTPRouteReferenceGrant conformance test.

Fixes #792
Fixes #788
Fixes #545

Signed-off-by: danehans daneyonhansen@gmail.com

@danehans danehans requested a review from a team as a code owner December 9, 2022 20:18
@danehans danehans marked this pull request as draft December 9, 2022 20:19
@codecov-commenter
Copy link

Codecov Report

Merging #793 (2f7102c) into main (7e176de) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #793      +/-   ##
==========================================
+ Coverage   62.01%   62.05%   +0.03%     
==========================================
  Files          46       46              
  Lines        5995     5993       -2     
==========================================
+ Hits         3718     3719       +1     
+ Misses       2043     2041       -2     
+ Partials      234      233       -1     
Impacted Files Coverage Δ
internal/provider/kubernetes/helpers.go 77.04% <ø> (+2.85%) ⬆️
internal/provider/kubernetes/controller.go 51.64% <0.00%> (-0.20%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danehans danehans changed the title WIP: Test HTTProute RefGrant Support Enables HTTPRouteReferenceGrant Conformance Test Dec 14, 2022
@danehans danehans marked this pull request as ready for review December 14, 2022 17:23
@danehans danehans marked this pull request as draft December 14, 2022 18:42
@danehans danehans marked this pull request as ready for review December 14, 2022 19:51
@danehans danehans changed the title Enables HTTPRouteReferenceGrant Conformance Test Add ReferenceGrant Support for Routes Dec 14, 2022
@danehans danehans added this to the 0.3.0-rc.1 milestone Dec 14, 2022
@danehans danehans added provider/kubernetes Issues related to the Kubernetes provider release-note Indicates a required release note labels Dec 14, 2022
@danehans
Copy link
Contributor Author

xref #780 for adding add'l conformance tests.

@skriss
Copy link
Contributor

skriss commented Dec 14, 2022

@danehans sounds like this closes #545? If so, can you add that to the "Fixes" list?

refGrant, err := r.findReferenceGrant(ctx, from, to)
if err != nil {
r.log.Error(err, "unable to find ReferenceGrant that links the Secret to Gateway")
continue
r.log.Error(err, "failed to find ReferenceGrant")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, can we add some more info here to difference which exact refgrant was not found

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, please ignore, looks like the callee function is printing out the details so prob not needed here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the log message to the calling func.

r.log.Info("failed to find Service", "namespace", serviceNamespaceName.Namespace,
"name", serviceNamespaceName.Name, "error", err)
} else {
return reconcile.Result{}, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this return be removed as well ?

Copy link
Contributor Author

@danehans danehans Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Yes, commit 365610b fixes this.

Signed-off-by: danehans <daneyonhansen@gmail.com>
@danehans danehans merged commit 71ace36 into envoyproxy:main Dec 17, 2022
arkodg added a commit to arkodg/gateway that referenced this pull request Dec 17, 2022
Enables `HTTPRoutePartiallyInvalidViaInvalidReferenceGrant`

Fixed by envoyproxy#793

Closes envoyproxy#781

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/kubernetes Issues related to the Kubernetes provider release-note Indicates a required release note
Projects
None yet
5 participants