From 0826d35498731a41b9e4d86c1c40cfd9c8ed0348 Mon Sep 17 00:00:00 2001 From: Honigeintopf Date: Wed, 6 Nov 2024 15:38:54 +0100 Subject: [PATCH] Add firewaldistance to InstallerConfig --- cmd/install.go | 27 ++++++++++++++------------- pkg/api/api.go | 2 ++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/cmd/install.go b/cmd/install.go index 1b30a0d2..58ac8d49 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -220,19 +220,20 @@ func (h *hammer) writeInstallerConfig(machine *models.V1MachineResponse, rootUUi } y := &api.InstallerConfig{ - Hostname: *alloc.Hostname, - SSHPublicKey: sshPubkeys, - Networks: alloc.Networks, - MachineUUID: h.spec.MachineUUID, - Password: h.spec.ConsolePassword, - Console: console, - Timestamp: time.Now().Format(time.RFC3339), - Nics: h.onlyNicsWithNeighbors(machine.Hardware.Nics), - VPN: alloc.Vpn, - Role: *alloc.Role, - RaidEnabled: raidEnabled, - RootUUID: rootUUiD, - FirewallRules: alloc.FirewallRules, + Hostname: *alloc.Hostname, + SSHPublicKey: sshPubkeys, + Networks: alloc.Networks, + MachineUUID: h.spec.MachineUUID, + Password: h.spec.ConsolePassword, + Console: console, + Timestamp: time.Now().Format(time.RFC3339), + Nics: h.onlyNicsWithNeighbors(machine.Hardware.Nics), + VPN: alloc.Vpn, + Role: *alloc.Role, + RaidEnabled: raidEnabled, + RootUUID: rootUUiD, + FirewallRules: alloc.FirewallRules, + FirewallDistance: 0, } yamlContent, err := yaml.Marshal(y) diff --git a/pkg/api/api.go b/pkg/api/api.go index e3e12562..f113edec 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -40,6 +40,8 @@ type InstallerConfig struct { RootUUID string `yaml:"root_uuid"` // FirewallRules if not empty firewall rules to enforce FirewallRules *models.V1FirewallRules `yaml:"firewall_rules"` + // FirewallDistance is used by the firewall-controller only not by machines + FirewallDistance uint8 `yaml:"firewall_distance"` } // FIXME legacy structs remove once old images are gone