Skip to content
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

Add IPv6 unittests for cluster setup #698

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

bschimke95
Copy link
Contributor

No description provided.

@bschimke95 bschimke95 requested a review from a team as a code owner September 25, 2024 19:04
@@ -81,7 +81,7 @@ func kubelet(snap snap.Snap, hostname string, nodeIP net.IP, clusterDNS string,
args["--cluster-domain"] = clusterDomain
}
if nodeIP != nil && !nodeIP.IsLoopback() {
args["--node-ip"] = utils.ToIPString(nodeIP)
args["--node-ip"] = nodeIP.String()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by fix: brackets around the IPv6 are only required/accepted if combined with a port.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to document this somewhere. I personally totally forgot about out brackets convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not our convention but the actual IP standard.

Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @bschimke95! Left some minor comments.

src/k8s/pkg/k8sd/setup/kube_apiserver_test.go Show resolved Hide resolved
key string
expectedVal string
}{
{key: "--advertise-address", expectedVal: "2001:db8::"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe we can extract these IP strings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test validates that the --advertise-address flag is configured with the IP string that we expect. I don't think it makes sense to have this as an IP object just to stringify it later in the test.

Or do I misunderstand your comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No no I mean that we could have variables for these IPs that we pass to both setup.KubeAPIServer() and expectedVal. It's not really important, ignore this if you don't feel like it.

@@ -81,7 +81,7 @@ func kubelet(snap snap.Snap, hostname string, nodeIP net.IP, clusterDNS string,
args["--cluster-domain"] = clusterDomain
}
if nodeIP != nil && !nodeIP.IsLoopback() {
args["--node-ip"] = utils.ToIPString(nodeIP)
args["--node-ip"] = nodeIP.String()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to document this somewhere. I personally totally forgot about out brackets convention.

src/k8s/pkg/k8sd/setup/kube_proxy_test.go Show resolved Hide resolved
Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we should get this in before #697 since that PR changes some of these setup functions. I can rebase and adjust the unit tests there.

Copy link
Contributor

@HomayoonAlimohammadi HomayoonAlimohammadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @bschimke95! LGTM

@bschimke95 bschimke95 merged commit d3c4a36 into main Sep 27, 2024
17 of 19 checks passed
@bschimke95 bschimke95 deleted the KU-1584/ipv6-testcases branch September 27, 2024 18:01
@bschimke95 bschimke95 mentioned this pull request Sep 27, 2024
evilnick pushed a commit to evilnick/k8s-snap that referenced this pull request Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants