-
Notifications
You must be signed in to change notification settings - Fork 32
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 dnspolicy crd validations #578
Merged
mikenairn
merged 2 commits into
Kuadrant:main
from
mikenairn:fix_dnspolicy_crd_validations
Apr 26, 2024
Merged
Update dnspolicy crd validations #578
mikenairn
merged 2 commits into
Kuadrant:main
from
mikenairn:fix_dnspolicy_crd_validations
Apr 26, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mikenairn
force-pushed
the
fix_dnspolicy_crd_validations
branch
from
April 25, 2024 14:23
fdf7805
to
4d59725
Compare
mikenairn
commented
Apr 25, 2024
The validations to ensure required fields were marked as required were incorrect. Any fields that are not explicitly marked with `+optional` and do not have `omitempty` are considered required.
mikenairn
force-pushed
the
fix_dnspolicy_crd_validations
branch
from
April 25, 2024 17:02
4d59725
to
c29d990
Compare
mikenairn
commented
Apr 25, 2024
@@ -208,7 +208,6 @@ func (dh *dnsHelper) getLoadBalancedEndpoints(mcgTarget *multicluster.GatewayTar | |||
} | |||
|
|||
var endpoint *externaldns.Endpoint | |||
var defaultEndpoint *externaldns.Endpoint |
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.
@makslion fyi, i removed this as it's not needed any longer. Also added some more relevant comments below.
mikenairn
force-pushed
the
fix_dnspolicy_crd_validations
branch
from
April 25, 2024 18:12
c29d990
to
0c0a4f0
Compare
Update the CRD validations to make the "loadBalancing" field required if the routingStrategy is "loadbalanced" and make the "defaultWeight" and "defaultGeo" fields mandatory within the "loadBalancing" section. Minimum valid specs are now: Simple: ``` spec: targetRef: name: prod-web group: gateway.networking.k8s.io kind: Gateway routingStrategy: simple ``` LoadBalanced: ``` spec: targetRef: name: prod-web group: gateway.networking.k8s.io kind: Gateway routingStrategy: loadbalanced loadBalancing: geo: defaultGeo: foo weighted: defaultWeight: 100 ```
mikenairn
force-pushed
the
fix_dnspolicy_crd_validations
branch
from
April 25, 2024 18:26
0c0a4f0
to
08c7cca
Compare
maleck13
approved these changes
Apr 26, 2024
/lgtm |
Test are still broken for other reasons, verified the dns tests locally:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #554
fix: DNSPolicy CRD required validations
The validations to ensure required fields were marked as required were incorrect.
Any fields that are not explicitly marked with
+optional
and do not haveomitempty
are considered required.Update loadbalanced routingStrategy CRD validation
Update the CRD validations to make the "loadBalancing" field required if the routingStrategy is "loadbalanced" and make the "defaultWeight" and "defaultGeo" fields mandatory within the "loadBalancing" section.
Minimum valid specs are now:
Simple:
LoadBalanced: