proxmoxve: explicit static IP configuration#1282
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Proxmox VE cloud-config provider to append :::off to the generated ip= kernel arguments for both IPv4 and IPv6 network configurations. Feedback suggests using network::dracut_addr to properly format IPv6 addresses to avoid parsing issues with dracut, and reminds the author to update the corresponding unit tests to match the new kernel argument format.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| kargs.push(format!( | ||
| "ip={}::{}:{}", | ||
| "ip={}::{}:{}:::off", | ||
| network.ip(), | ||
| gateway.gateway, | ||
| network.prefix() | ||
| )); | ||
| } else { | ||
| kargs.push(format!("ip={}:::{}", network.ip(), network.prefix())); | ||
| kargs.push(format!("ip={}:::{}:::off", network.ip(), network.prefix())); | ||
| } |
There was a problem hiding this comment.
For IPv6 addresses, dracut's colon-separated parser requires them to be enclosed in square brackets (e.g., [2001:db8::1]) so that the colons in the IPv6 address are not mistaken for field separators. Since you are modifying these lines, please use the helper network::dracut_addr to correctly format the IPv6 addresses.
kargs.push(format!(
"ip={}::{}:{}:::off",
network::dracut_addr(&IpAddr::V6(network.ip())),
network::dracut_addr(&gateway.gateway),
network.prefix()
));
} else {
kargs.push(format!(
"ip={}:::{}:::off",
network::dracut_addr(&IpAddr::V6(network.ip())),
network.prefix()
));
}| kargs.push(format!( | ||
| "ip={}::{}:{}", | ||
| "ip={}::{}:{}:::off", | ||
| network.ip(), | ||
| gateway.gateway, | ||
| network.mask() | ||
| )); | ||
| } else { | ||
| kargs.push(format!("ip={}:::{}", network.ip(), network.mask())); | ||
| kargs.push(format!("ip={}:::{}:::off", network.ip(), network.mask())); | ||
| } |
There was a problem hiding this comment.
The changes to the kernel arguments format (appending :::off) will cause the existing unit tests in src/providers/proxmoxve/tests.rs to fail, as they still assert the old format without the :::off suffix. Please update test_network_kargs and test_network_kargs_no_gateway in src/providers/proxmoxve/tests.rs to match the new format.
ed2e4f4 to
b3b0531
Compare
This costs nothing to append - dracut explodes this 'ip=' into variables[^1], and downstream libraries might default to 'dhcp' if the 'autoconf' variable is empty. [^1]: https://github.com/dracutdevs/dracut/blob/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9/modules.d/40network/net-lib.sh#L541 Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
b3b0531 to
c181f17
Compare
This costs nothing to append - dracut explodes this 'ip=' into variables1, and downstream libraries might default to 'dhcp' if the 'autoconf' variable is empty.
Related to: flatcar/Flatcar#2002, flatcar/scripts#3677
(cc @theoraim)
Footnotes
https://github.com/dracutdevs/dracut/blob/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9/modules.d/40network/net-lib.sh#L541 ↩