From ab8fbf149cbce7df685105b582e6b79b76b540a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Hor=C3=A1=C4=8Dek?= Date: Thu, 25 Feb 2021 14:57:15 +0100 Subject: [PATCH] Revert "Explicitly unmanage veth interfaces (#701)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f717775686d23a68ccbb533830a5dd036383095f. Signed-off-by: Petr Horáček --- build/bin/unmanaged-veth | 6 ------ deploy/handler/operator.yaml | 6 ------ main.go | 16 ---------------- 3 files changed, 28 deletions(-) delete mode 100755 build/bin/unmanaged-veth diff --git a/build/bin/unmanaged-veth b/build/bin/unmanaged-veth deleted file mode 100755 index 32733cc76..000000000 --- a/build/bin/unmanaged-veth +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -xe - -echo '[keyfile] -unmanaged-devices=interface-name:veth* -' > /host/etc/NetworkManager/conf.d/001-cnv-unmanaged-veth.conf -dbus-send --system --dest=org.freedesktop.systemd1 --type=method_call /org/freedesktop/systemd1 --print-reply org.freedesktop.systemd1.Manager.ReloadUnit string:NetworkManager.service string:replace diff --git a/deploy/handler/operator.yaml b/deploy/handler/operator.yaml index c455212a2..d5a2fe82c 100644 --- a/deploy/handler/operator.yaml +++ b/deploy/handler/operator.yaml @@ -153,8 +153,6 @@ spec: volumeMounts: - name: dbus-socket mountPath: /run/dbus/system_bus_socket - - name: networkmanager-config - mountPath: /host/etc/NetworkManager/conf.d - name: nmstate-lock mountPath: /var/k8s_nmstate securityContext: @@ -164,10 +162,6 @@ spec: hostPath: path: /run/dbus/system_bus_socket type: Socket - - name: networkmanager-config - hostPath: - path: /etc/NetworkManager/conf.d - type: Directory - name: nmstate-lock hostPath: path: /var/k8s_nmstate diff --git a/main.go b/main.go index 20bcd8db3..03f26cb98 100644 --- a/main.go +++ b/main.go @@ -17,13 +17,11 @@ limitations under the License. package main import ( - "bytes" "flag" "fmt" "net/http" _ "net/http/pprof" "os" - "os/exec" "time" "k8s.io/apimachinery/pkg/runtime" @@ -47,8 +45,6 @@ import ( "github.com/nmstate/kubernetes-nmstate/pkg/webhook" ) -const unmanagedVethCommand = "unmanaged-veth" - type ProfilerConfig struct { EnableProfiler bool `envconfig:"ENABLE_PROFILER"` ProfilerPort string `envconfig:"PROFILER_PORT" default:"6060"` @@ -85,8 +81,6 @@ func main() { } defer handlerLock.Unlock() setupLog.Info("Successfully took nmstate exclusive lock") - - setVethInterfacesAsUnmanaged() } ctrlOptions := ctrl.Options{ @@ -220,13 +214,3 @@ func lockHandler() (lockfile.Lockfile, error) { }) return handlerLock, err } - -func setVethInterfacesAsUnmanaged() { - cmd := exec.Command(unmanagedVethCommand) - var stdout, stderr bytes.Buffer - cmd.Stdout = &stdout - cmd.Stderr = &stderr - if err := cmd.Run(); err != nil { - setupLog.Info(fmt.Sprintf("failed to execute %s: '%v', '%s', '%s'", unmanagedVethCommand, err, stdout.String(), stderr.String())) - } -}