-
Notifications
You must be signed in to change notification settings - Fork 34
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
Improve policy constraint error message #145
Conversation
I think you meant |
c1cbbf9
to
e1c310d
Compare
e1c310d
to
e668493
Compare
LGTM There are conflicts to be merged as |
@@ -20,7 +22,7 @@ func (r *AuthPolicyReconciler) reconcileAuthConfigs(ctx context.Context, ap *api | |||
return err | |||
} | |||
|
|||
authConfig, err := r.desiredAuthConfig(ctx, ap, targetNetworkObject) | |||
authConfig, err := r.desiredAuthConfig(ap, targetNetworkObject) |
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.
Nice catch!
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.
👍
* There was no need to pass ctx and have them repeated in the controllers
e668493
to
683c497
Compare
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.
The message is certainly better
* rlp: validate httproute target is accepted * fix lint issues
This PR besides aiming to improve the policy constrain error message, introduces a minor refactor.
TargetHostnames
andValidateHierarchicalRules
were controller methods that didn't need to make any use of the K8s client, thus they were extracted, simplified and unit tested .The error message now looks like this:
This new version, besides showing the wrong policy target hostname, it shows the Type of the policy being reconciled and the target network object (HTTPRoute or Gateway) hostnames.
closes #113
Verification Steps
Note the
hostnames
value being"*toystore.com"
Note here that the
spec.rateLimits[0].hosts
value is"*.petstore.com"