-
Notifications
You must be signed in to change notification settings - Fork 52
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
update validations and status on route reconciler #563
Conversation
24280d6
to
78c5f91
Compare
Is the message of an Accepted status supposed to state the backendref's name in the spec, or is this a custom decision? |
// There are 3 condition types: Accepted, PartiallyInvalid, ResolvedRefs. | ||
// We dont support PartiallyInvalid for now and reject entire route if there is at least one invalid field. | ||
// Accepted type is related to parentRefs, and ResolvedRefs to backendRefs. These 2 are validated independently. | ||
func (r *routeReconciler) validateRoute(ctx context.Context, route core.Route) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable names in this function are hard to understand. Let's please stick to camelCase words
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
message is primarily for human readable error details
|
pkg/model/core/grpcroute.go
Outdated
@@ -79,6 +79,13 @@ func (r *GRPCRoute) Inner() *gwv1alpha2.GRPCRoute { | |||
return &r.r | |||
} | |||
|
|||
func (r *GRPCRoute) GK() metav1.GroupKind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why GK() instead of GroupKind()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its GK or GKV in other places of kubernetes: controller-runtime for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am only able to find examples of GroupKind(), such as here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/client/apiutil
if it bothers you I can change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be my preference, primarily for readability
Note:
Add Gateway API Spec validations to route controller. Spec is not valid if there is at least single invalid property in ParentRef or BackendRef.
Tests:
Example for new status:
close #544
close #540
close #277