-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
Populate ClusterIPs on read #95894
Populate ClusterIPs on read #95894
Conversation
/triage accepted |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/retest |
95586ab
to
6ca5e7f
Compare
Rebase and push to retrigger tests. |
svcreg.NormalizeClusterIPs(nil, service) | ||
|
||
// The rest of this does not apply unless dual-stack is enabled. | ||
if !utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) { |
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.
gate should be on defaultOnRead(..)
first thing. Instead of for-each-item-on-list.
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 question is whether we expect clusterIPs
to have a value when the gate is disabled? Based on the logic in dropServiceDisabledFields()
, I assumed that was your intention:
if !utilfeature.DefaultFeatureGate.Enabled(features.IPv6DualStack) && !strategy.serviceDualStackFieldsInUse(oldSvc) {
newSvc.Spec.IPFamilies = nil
newSvc.Spec.IPFamilyPolicy = nil
if len(newSvc.Spec.ClusterIPs) > 1 {
newSvc.Spec.ClusterIPs = newSvc.Spec.ClusterIPs[0:1]
}
}
If we leave that as-is, then we really need to populate it on read (regardless of the gate). If we don't populate on read (when gated off), we should just set it to nil when writing. It either always has a value or never. But lots of internal logic depends on it having a value, so this seemed cleaner.
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.
oh yes. I missed that one.
/retest one small change requested, but otherwise i think we are good. |
/retest |
rebased |
a13c930
to
cae8801
Compare
/test pull-kubernetes-e2e-azure-dualstack the unit test errors are legit, didn' t look if it is the test or the code |
cae8801
to
f24f30d
Compare
f24f30d
to
adfbd82
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: khenidak, thockin 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 |
Old stored services will not have the `clusterIPs` field when read back without this. This includes some renaming for clarity and expanded comments, and a new test for default on read.
adfbd82
to
a4c9330
Compare
rebased, will need new lgtm |
@thockin: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
/retest |
/lgtm |
Old stored services will not have the
clusterIPs
field when read backwithout this.
This includes some renaming for clarity and expanded comments, and a new
test for default on read.
/kind bug
/kind api-change
/sig network