Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node agent not installed #116

Merged
merged 3 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions cbcontainers/state/components/sensor_daemon_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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{}
}
Expand All @@ -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) {
Expand Down