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