-
Notifications
You must be signed in to change notification settings - Fork 1k
Fallback to clusterip to determine the service ipfamily #1238
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
Conversation
|
Fixes #1231 |
rata
left a comment
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.
LGTM, thanks a lot @fedepaol
I haven't tested this, but what you did seems enough :)
|
I feel if we are in this mode we should fail any attempt to provision svc with dual stack ? |
That will come for free as in 1.19 there's no dual stack fields, which is exactly the reason why we need to fallback to ClusterIP |
we have annotations that someone mistakenly can use with older k8s right ? |
Yes, and that would fail because the ip families would not match |
maybe worth adding testcase to make sure this should fail if it not already there |
We don't have 1.19 in our CI lanes (and I don't think it's worth adding a lane for a k8s version that is not supported) |
I was asking about unit-test test case |
Ah then yes, I can add it, and makes sense, you are right. |
48d31e7 to
d3d0d15
Compare
controller/service.go
Outdated
| }) | ||
| return reflect.DeepEqual(ipsA, ipsB) | ||
| } | ||
|
|
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.
shouldn't we have this function in ipfamily package ?
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 reason why I put this here was that the ipfamily package is (was) about ips and families and independent from k8s concepts, so it's a bit borderline and felt more like a local util function.
I don't have a strong opinion though, ipfamily.ForService sounds as much as good. Will move it.
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.
heh, I started a similar comment, then realized the ipFamily pkg was agnostic of k8s and decided it was fine too.
I am all for ipfamily.ForService, but if you do it and decide it doesn't fit, I'm ok with how the code currently is too :)
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 just pushed the change :-)
4c52758 to
0f708ff
Compare
K8s versions prior to 1.20 do not have ClusterIPs set, so we fallback to clusterip (singular) to determine the ip family. Signed-off-by: Federico Paolinelli <fpaoline@redhat.com>
rata
left a comment
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.
LGTM, thanks!
K8s versions prior to 1.20 do not have ClusterIPs set, so we fallback to clusterip (singular) to determine the ip family.
Tested locally with
inv dev-env --node-img=kindest/node:v1.19.11@sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729as the CI lanes are running against 1.21.