From 392625b774ae019b493988c33f424a292e147804 Mon Sep 17 00:00:00 2001 From: alegrey91 Date: Mon, 10 Jan 2022 18:39:06 +0100 Subject: [PATCH] style(host-sensor): move kube-host-sensor manifest to indipendent yaml file --- hostsensorutils/{hostsensoryamls.go => hostsensor.yaml} | 6 ++---- hostsensorutils/hostsensordeploy.go | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) rename hostsensorutils/{hostsensoryamls.go => hostsensor.yaml} (94%) diff --git a/hostsensorutils/hostsensoryamls.go b/hostsensorutils/hostsensor.yaml similarity index 94% rename from hostsensorutils/hostsensoryamls.go rename to hostsensorutils/hostsensor.yaml index a29bcce8..305bd09b 100644 --- a/hostsensorutils/hostsensoryamls.go +++ b/hostsensorutils/hostsensor.yaml @@ -1,6 +1,4 @@ -package hostsensorutils - -const hostSensorYAML = `apiVersion: v1 +apiVersion: v1 kind: Namespace metadata: labels: @@ -62,4 +60,4 @@ spec: name: host-filesystem hostNetwork: true hostPID: true - hostIPC: true` + hostIPC: true \ No newline at end of file diff --git a/hostsensorutils/hostsensordeploy.go b/hostsensorutils/hostsensordeploy.go index 06e1c008..3d7042e8 100644 --- a/hostsensorutils/hostsensordeploy.go +++ b/hostsensorutils/hostsensordeploy.go @@ -1,6 +1,7 @@ package hostsensorutils import ( + _ "embed" "fmt" "io" "strings" @@ -18,6 +19,11 @@ import ( coreapplyv1 "k8s.io/client-go/applyconfigurations/core/v1" ) +var ( + //go:embed hostsensor.yaml + hostSensorYAML string +) + type HostSensorHandler struct { HostSensorPort int32 HostSensorPodNames map[string]string //map from pod names to node names