From 3a8ff7b8fa352fccc46793b485915b4e2dfa7071 Mon Sep 17 00:00:00 2001 From: dusdjhyeon Date: Tue, 16 Jul 2024 10:47:11 +0900 Subject: [PATCH 1/2] feat: migration base image Signed-off-by: dusdjhyeon --- build/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 1c919b4c6..812b80385 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -17,13 +17,15 @@ RUN go env RUN CGO_ENABLED=0 go build -buildvcs=false -o /output/chaos-operator -v ./main.go # Packaging stage -# Image source: https://github.com/litmuschaos/test-tools/blob/master/custom/hardened-alpine/infra/Dockerfile -# The base image is non-root (have litmus user) with default litmus directory. -FROM litmuschaos/infra-alpine +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4 LABEL maintainer="LitmusChaos" ENV OPERATOR=/usr/local/bin/chaos-operator + COPY --from=builder /output/chaos-operator ${OPERATOR} +RUN chown 65534:0 ${OPERATOR} && chmod 755 ${OPERATOR} + +USER 65534 ENTRYPOINT ["/usr/local/bin/chaos-operator"] From bb7ea39bcdfda154cf635845bf8b522681dada30 Mon Sep 17 00:00:00 2001 From: Shubham Chaudhary Date: Tue, 16 Jul 2024 11:47:00 +0530 Subject: [PATCH 2/2] chore(operator): Fix the lint (#500) Signed-off-by: Shubham Chaudhary --- controllers/chaosengine_controller_test.go | 2 +- pkg/utils/volumeUtils.go | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/controllers/chaosengine_controller_test.go b/controllers/chaosengine_controller_test.go index ad3eb6f5f..3219e2ad1 100644 --- a/controllers/chaosengine_controller_test.go +++ b/controllers/chaosengine_controller_test.go @@ -1621,7 +1621,7 @@ func TestReconcileForCreationAndRunning(t *testing.T) { func CreateFakeClient(t *testing.T) *ChaosEngineReconciler { - fakeClient := litmusFakeClientset.NewFakeClient() + fakeClient := litmusFakeClientset.NewClientBuilder().WithRuntimeObjects().Build() if fakeClient == nil { fmt.Println("litmusClient is not created") } diff --git a/pkg/utils/volumeUtils.go b/pkg/utils/volumeUtils.go index 3e7282ab1..d3e3dbd8f 100644 --- a/pkg/utils/volumeUtils.go +++ b/pkg/utils/volumeUtils.go @@ -6,11 +6,6 @@ import ( corev1 "k8s.io/api/core/v1" ) -var ( - // hostpathTypeFile represents the hostpath type - hostpathTypeFile = corev1.HostPathFile -) - // CreateVolumeBuilders build Volume needed in execution of experiments func CreateVolumeBuilders(configMaps []v1alpha1.ConfigMap, secrets []v1alpha1.Secret) []*volume.Builder { volumeBuilderList := []*volume.Builder{}