-
Notifications
You must be signed in to change notification settings - Fork 1
fix: Adding ipv6 check on the node init function #10
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
base: pr_050_before
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -128,6 +128,16 @@ func WaitForNodeInformation(ctx context.Context, log logrus.FieldLogger, localNo | |||||||||||||||||||||||||||||||||
| logfields.K8sNodeIP: k8sNodeIP, | ||||||||||||||||||||||||||||||||||
| }).Info("Received own node information from API server") | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // If the host does not have an IPv6 address, return an error | ||||||||||||||||||||||||||||||||||
| if option.Config.EnableIPv6 && nodeIP6 == nil { | ||||||||||||||||||||||||||||||||||
| log.WithFields(logrus.Fields{ | ||||||||||||||||||||||||||||||||||
| logfields.NodeName: n.Name, | ||||||||||||||||||||||||||||||||||
| logfields.IPAddr + ".ipv4": nodeIP4, | ||||||||||||||||||||||||||||||||||
| logfields.IPAddr + ".ipv6": nodeIP6, | ||||||||||||||||||||||||||||||||||
| }).Error("No IPv6 support on node as ipv6 address is nil") | ||||||||||||||||||||||||||||||||||
| return fmt.Errorf("node %s does not have an IPv6 address", n.Name) | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+131
to
+138
|
||||||||||||||||||||||||||||||||||
| // If the host does not have an IPv6 address, return an error | |
| if option.Config.EnableIPv6 && nodeIP6 == nil { | |
| log.WithFields(logrus.Fields{ | |
| logfields.NodeName: n.Name, | |
| logfields.IPAddr + ".ipv4": nodeIP4, | |
| logfields.IPAddr + ".ipv6": nodeIP6, | |
| }).Error("No IPv6 support on node as ipv6 address is nil") | |
| return fmt.Errorf("node %s does not have an IPv6 address", n.Name) | |
| // If the host does not have an IPv6 address, log a warning but continue; | |
| // useNodeCIDR() will enforce any required IPv6 PodCIDR constraints. | |
| if option.Config.EnableIPv6 && nodeIP6 == nil { | |
| log.WithFields(logrus.Fields{ | |
| logfields.NodeName: n.Name, | |
| logfields.IPAddr + ".ipv4": nodeIP4, | |
| logfields.IPAddr + ".ipv6": nodeIP6, | |
| }).Warning("IPv6 is enabled but node IPv6 address is currently nil; proceeding and relying on CIDR-based checks") |
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 error message 'No IPv6 support on node as ipv6 address is nil' is technically inaccurate. The node may support IPv6, but simply doesn't have an IPv6 address configured. Consider changing to 'IPv6 is enabled but node does not have an IPv6 address configured' for clarity.