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

fix(vm-network): fix iptables rules #2388

Merged
merged 8 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 83 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/server-config/src/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ pub struct VmConfig {

#[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq)]
pub struct VmNetworkConfig {
#[serde(default)]
pub interface: Option<String>,
#[serde(default = "default_bridge_name")]
pub bridge_name: String,
pub public_ip: Ipv4Addr,
Expand Down
2 changes: 2 additions & 0 deletions crates/server-config/src/resolved_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@ mod tests {
libvirt_uri = "qemu:///system"
allow_gpu = true
[vm.network]
interface = "eth0"
bridge_name = "br422442"
public_ip = "1.1.1.1"
vm_ip = "2.2.2.2"
Expand All @@ -883,6 +884,7 @@ mod tests {
libvirt_uri: "qemu:///system".to_string(),
allow_gpu: true,
network: VmNetworkConfig {
interface: Some("eth0".to_string()),
bridge_name: "br422442".to_string(),
public_ip: Ipv4Addr::new(1, 1, 1, 1),
vm_ip: Ipv4Addr::new(2, 2, 2, 2),
Expand Down
7 changes: 2 additions & 5 deletions crates/vm-network-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ name = "vm-network-utils"
version = "0.1.0"
edition = "2021"

[[bin]]
name = 'vm-network-utils'
path = "bin/main.rs"

[target.'cfg(target_os = "linux")'.dependencies]
iptables = "0.5.2"

[dependencies]
thiserror = { workspace = true }
tracing = { workspace = true }
tracing = { workspace = true }
netdev = "0.31.0"
37 changes: 0 additions & 37 deletions crates/vm-network-utils/bin/main.rs

This file was deleted.

Loading
Loading