From 8e0ccf07ea81a2f080d3eb92fa8a397f9ebaf3a9 Mon Sep 17 00:00:00 2001 From: Tomer Shefler Date: Wed, 3 Aug 2022 12:03:16 +0300 Subject: [PATCH 1/3] fix missing & --- cbcontainers/state/components/sensor_daemon_set.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbcontainers/state/components/sensor_daemon_set.go b/cbcontainers/state/components/sensor_daemon_set.go index 3b5e130d..7568fce6 100644 --- a/cbcontainers/state/components/sensor_daemon_set.go +++ b/cbcontainers/state/components/sensor_daemon_set.go @@ -180,7 +180,7 @@ func (obj *SensorDaemonSetK8sObject) mutateContainersList(daemonSet *appsV1.Daem var runtimeContainer coreV1.Container var clusterScannerContainer coreV1.Container - templatePodSpec := daemonSet.Spec.Template.Spec + templatePodSpec := &daemonSet.Spec.Template.Spec desiredContainers := make([]coreV1.Container, 0, 2) runtimeEnabled := false From 5a79bb043b07ee9eb48511a85092225070a0880f Mon Sep 17 00:00:00 2001 From: Tomer Shefler Date: Wed, 3 Aug 2022 12:04:51 +0300 Subject: [PATCH 2/3] remove unused parameter --- cbcontainers/state/components/sensor_daemon_set.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cbcontainers/state/components/sensor_daemon_set.go b/cbcontainers/state/components/sensor_daemon_set.go index 7568fce6..ab38269d 100644 --- a/cbcontainers/state/components/sensor_daemon_set.go +++ b/cbcontainers/state/components/sensor_daemon_set.go @@ -274,7 +274,7 @@ func (obj *SensorDaemonSetK8sObject) mutateRuntimeContainer(container *coreV1.Co container.Ports = []coreV1.ContainerPort{{Name: "metrics", ContainerPort: int32(sensorSpec.Prometheus.Port)}} } obj.mutateRuntimeEnvVars(container, agentSpec) - obj.mutateSecurityContext(container, agentSpec) + obj.mutateSecurityContext(container) } func (obj *SensorDaemonSetK8sObject) mutateRuntimeEnvVars(container *coreV1.Container, agentSpec *cbContainersV1.CBContainersAgentSpec) { @@ -298,7 +298,7 @@ func (obj *SensorDaemonSetK8sObject) mutateRuntimeEnvVars(container *coreV1.Cont commonState.MutateEnvVars(container, envVarBuilder) } -func (obj *SensorDaemonSetK8sObject) mutateSecurityContext(container *coreV1.Container, agentSpec *cbContainersV1.CBContainersAgentSpec) { +func (obj *SensorDaemonSetK8sObject) mutateSecurityContext(container *coreV1.Container) { if container.SecurityContext == nil { container.SecurityContext = &coreV1.SecurityContext{} } @@ -320,7 +320,7 @@ func (obj *SensorDaemonSetK8sObject) mutateClusterScannerContainer(container *co } obj.mutateClusterScannerEnvVars(container, agentSpec) obj.mutateClusterScannerVolumesMounts(container, agentSpec) - obj.mutateSecurityContext(container, agentSpec) + obj.mutateSecurityContext(container) } func (obj *SensorDaemonSetK8sObject) mutateClusterScannerEnvVars(container *coreV1.Container, agentSpec *cbContainersV1.CBContainersAgentSpec) { From 833ffd6fd6b6b0d6c7f40376b0917d115b03138f Mon Sep 17 00:00:00 2001 From: Tomer Shefler Date: Wed, 3 Aug 2022 12:09:33 +0300 Subject: [PATCH 3/3] Dockerfile: update go version to 1.18 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 03661a02..d3c22832 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.17 as builder +FROM golang:1.18 as builder WORKDIR /workspace # Copy the Go Modules manifests