From 0f7b21ad0020802ae13945b255b7e91d39a6bb25 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 6 Jun 2025 19:17:20 +0200 Subject: [PATCH] pkg/machine: remove unsused net recover file This is not used in the code so it can be deleted. Signed-off-by: Paul Holzinger --- pkg/machine/ignition/ignition.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/pkg/machine/ignition/ignition.go b/pkg/machine/ignition/ignition.go index e9ae184d2a..b381daff20 100644 --- a/pkg/machine/ignition/ignition.go +++ b/pkg/machine/ignition/ignition.go @@ -631,24 +631,6 @@ func (i *IgnitionBuilder) Build() error { return i.dynamicIgnition.Write() } -func GetNetRecoveryFile() string { - return `#!/bin/bash -# Verify network health, and bounce the network device if host connectivity -# is lost. This is a temporary workaround for a known rare qemu/virtio issue -# that affects some systems - -sleep 120 # allow time for network setup on initial boot -while true; do - sleep 30 - curl -s -o /dev/null --max-time 30 http://192.168.127.1/health - if [ "$?" != "0" ]; then - echo "bouncing nic due to loss of connectivity with host" - ifconfig enp0s1 down; ifconfig enp0s1 up - fi -done -` -} - func (i *IgnitionBuilder) AddPlaybook(contents string, destPath string, username string) error { // create the ignition file object f := File{ @@ -694,19 +676,6 @@ func (i *IgnitionBuilder) AddPlaybook(contents string, destPath string, username return nil } -func GetNetRecoveryUnitFile() *parser.UnitFile { - recoveryUnit := parser.NewUnitFile() - recoveryUnit.Add("Unit", "Description", "Verifies health of network and recovers if necessary") - recoveryUnit.Add("Unit", "After", "sshd.socket sshd.service") - recoveryUnit.Add("Service", "ExecStart", "/usr/local/bin/net-health-recovery.sh") - recoveryUnit.Add("Service", "StandardOutput", "journal") - recoveryUnit.Add("Service", "StandardError", "journal") - recoveryUnit.Add("Service", "StandardInput", "null") - recoveryUnit.Add("Install", "WantedBy", "default.target") - - return recoveryUnit -} - func DefaultReadyUnitFile() parser.UnitFile { u := parser.NewUnitFile() u.Add("Unit", "After", "sshd.socket sshd.service")