Skip to content

Commit

Permalink
fix for disabling HostLogs in k8s env
Browse files Browse the repository at this point in the history
* also a quick fix for not keeping cache for apk reducing the image size

Signed-off-by: Rahul Jadhav <[email protected]>
  • Loading branch information
nyrahul committed Mar 17, 2022
1 parent 7d78301 commit 4145fcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

FROM golang:1.17.5-alpine3.15 as builder

RUN apk update
RUN apk --no-cache update
RUN apk add --no-cache bash git wget python3 linux-headers build-base clang clang-dev libc-dev bcc-tools bcc-dev protobuf

WORKDIR /usr/src/KubeArmor
Expand All @@ -21,11 +21,11 @@ RUN make

FROM alpine:3.15

RUN apk update
RUN apk --no-cache update
RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" | tee -a /etc/apk/repositories
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" | tee -a /etc/apk/repositories

RUN apk update
RUN apk --no-cache update
RUN apk add bcc-tools bcc-dev
RUN apk add bash curl procps
RUN apk add apparmor@community apparmor-utils@community kubectl@testing
Expand Down
2 changes: 1 addition & 1 deletion KubeArmor/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func LoadConfig() error {
GlobalCfg.K8sEnv = viper.GetBool(ConfigK8sEnv)

if GlobalCfg.HostVisibility == "" {
if GlobalCfg.KVMAgent || GlobalCfg.HostPolicy {
if GlobalCfg.KVMAgent || (!GlobalCfg.K8sEnv && GlobalCfg.HostPolicy) {
GlobalCfg.HostVisibility = "process,file,network,capabilities"
} else { // k8s
GlobalCfg.HostVisibility = "none"
Expand Down

0 comments on commit 4145fcb

Please sign in to comment.