-
Notifications
You must be signed in to change notification settings - Fork 565
feat: make Gateway.Spec.Addresses.Value
optional
#3616
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
feat: make Gateway.Spec.Addresses.Value
optional
#3616
Conversation
Hi @EyalPazz. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
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.
This needs more specification; changing a field to optional is not a breaking change, but it is a big one that will require code updates from all controllers. If you are proposing this, including how to handle empty values for implementations that support it and do not will be important.
We may also need an extended feature to cover this GatewayAddressEmpty
or something, so that we can slice the conformance tests accordingly.
@@ -672,6 +672,7 @@ type GatewayAddress struct { | |||
// | |||
// Examples: `1.2.3.4`, `128::1`, `my-ip-address`. | |||
// | |||
// +optional |
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.
This needs some more explanation:
- what behavior is expected if an implementation supports an empty
Value
here? - what behavior is expected if an implementation does not support an empty
Value
here?
This should then guide you to adding some conformance tests for implementations to test against.
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.
amazing thanks!
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.
+1 to @youngnick's comments, a couple suggestions as a starting point:
- If an implementation does support an empty value, we expect them to assign an address matching the type that has been requested with a value of the implementation's choice.
- If an implementation does not support an empty value, we expect them to set the
Programmed
condition in status toFalse
with a reason ofAddressNotAssigned
. Here's what that reason means as a reference:
gateway-api/apis/v1/gateway_types.go
Lines 874 to 886 in d936258
// This reason is used with the "Programmed" condition when the underlying | |
// implementation and network have yet to dynamically assign addresses for a | |
// Gateway. | |
// | |
// Some example situations where this reason can be used: | |
// | |
// * IPAM address exhaustion | |
// * Address not yet allocated | |
// | |
// When this reason is used the implementation SHOULD provide a clear | |
// message explaining the underlying problem, ideally with some hints as to | |
// what actions can be taken that might resolve the problem. | |
GatewayReasonAddressNotAssigned GatewayConditionReason = "AddressNotAssigned" |
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 think the extra doc requirement here got missed. I'd still like to see some description of what should happen in both cases on this field, if it's supported and not.
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.
Thanks for catching this @youngnick! @EyalPazz any chance you can squeeze this in in the next day or two? Really hoping we can fit this into v1.3 if possible, and we'll need to cut a RC pretty soon.
26365be
to
d39cc82
Compare
@youngnick, this isn't ready for merge yet, i wanted your opinion on injecting a valid |
d39cc82
to
581ba80
Compare
@shaneutt , i'd also appreciate your opinion here, as i saw you wrote the |
That seems reasonable, yes. |
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.
Thanks for taking this on @EyalPazz!
@@ -672,6 +672,7 @@ type GatewayAddress struct { | |||
// | |||
// Examples: `1.2.3.4`, `128::1`, `my-ip-address`. | |||
// | |||
// +optional |
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.
+1 to @youngnick's comments, a couple suggestions as a starting point:
- If an implementation does support an empty value, we expect them to assign an address matching the type that has been requested with a value of the implementation's choice.
- If an implementation does not support an empty value, we expect them to set the
Programmed
condition in status toFalse
with a reason ofAddressNotAssigned
. Here's what that reason means as a reference:
gateway-api/apis/v1/gateway_types.go
Lines 874 to 886 in d936258
// This reason is used with the "Programmed" condition when the underlying | |
// implementation and network have yet to dynamically assign addresses for a | |
// Gateway. | |
// | |
// Some example situations where this reason can be used: | |
// | |
// * IPAM address exhaustion | |
// * Address not yet allocated | |
// | |
// When this reason is used the implementation SHOULD provide a clear | |
// message explaining the underlying problem, ideally with some hints as to | |
// what actions can be taken that might resolve the problem. | |
GatewayReasonAddressNotAssigned GatewayConditionReason = "AddressNotAssigned" |
@youngnick @robscott can you please re-review this? |
4cd24c2
to
687de42
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.
Thanks @EyalPazz!
Hey @EyalPazz, I chatted with @youngnick about this and we agreed that it would make sense to move the conformance test for this into a follow up PR. The rationale is that as long as we have a clearly defined API spec for this, the conformance test would be covering with 99+% of implementations already do (automatically assign an IP address to a Gateway), so it's not quite as critical as we'd initially thought. Will you have time to update the PR in the next day or two to reflect this new smaller scope? Would love to get this into v1.3 if possible. |
Yea for sure, i'll do it tomorrow morning |
Should be ok now :) @robscott |
Thanks @EyalPazz! Will leave final LGTM for @youngnick or someone else. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: EyalPazz, robscott The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I missed something when I approved. Adding a hold until #3616 (comment) is addressed. /hold |
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.
Thanks @EyalPazz! This mostly LGTM, just needs another codegen run and a bit of clarification in the spec.
Thanks @EyalPazz! This LGTM, will defer to @youngnick for final approval. /hold cancel |
Thanks for the extra changes @EyalPazz, great work. /lgtm |
) * feat: make `Gateway.Spec.Addresses.Value` optional * wip: test mock * feat: flag injection & change `GatewayAddress` -> `GatewaySpecAddress` * add `omitempty` to the value * chore: update codegen * fix: type validation and minLength * chore: remove conformance test for now * complete rename of `GatewayAddress` -> `GatewaySpecAddress` * fix: improve docs for value field * fix: value field doc
What type of PR is this?
/kind feature
Which issue(s) this PR fixes:
Fixes #3612
Does this PR introduce a user-facing change?: