-
Notifications
You must be signed in to change notification settings - Fork 132
proxmoxve: explicit static IP configuration #1282
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
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| use crate::{ | ||
| network::{self, DhcpSetting, NetworkRoute}, | ||
| network::{self, dracut_addr, DhcpSetting, NetworkRoute}, | ||
| providers::MetadataProvider, | ||
| }; | ||
| use anyhow::{Context, Result}; | ||
|
|
@@ -199,13 +199,17 @@ impl MetadataProvider for ProxmoxVECloudConfig { | |
| .find(|r| r.destination.is_ipv4() && r.destination.prefix() == 0) | ||
| { | ||
| 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() | ||
| )); | ||
| } | ||
| } | ||
| IpNetwork::V6(network) => { | ||
|
|
@@ -215,13 +219,17 @@ impl MetadataProvider for ProxmoxVECloudConfig { | |
| .find(|r| r.destination.is_ipv6() && r.destination.prefix() == 0) | ||
| { | ||
| kargs.push(format!( | ||
| "ip={}::{}:{}", | ||
| network.ip(), | ||
| gateway.gateway, | ||
| "ip={}::{}:{}:::off", | ||
| dracut_addr(&IpAddr::V6(network.ip())), | ||
| dracut_addr(&gateway.gateway), | ||
| network.prefix() | ||
| )); | ||
| } else { | ||
| kargs.push(format!("ip={}:::{}", network.ip(), network.prefix())); | ||
| kargs.push(format!( | ||
| "ip={}:::{}:::off", | ||
| dracut_addr(&IpAddr::V6(network.ip())), | ||
| network.prefix() | ||
| )); | ||
| } | ||
|
Comment on lines
221
to
233
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For IPv6 addresses, dracut's colon-separated parser requires them to be enclosed in square brackets (e.g., 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()
));
}
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tormath1 I think this is a valid bug, it looks like the KubeVirt provider already does this correctly (src/providers/kubevirt/cloudconfig.rs:204).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, this is now done and tests are updated as well. |
||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.