From dd6f8b073823968abe46dd46d71b1e6e33250cb7 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Wed, 24 May 2023 11:02:28 +0300 Subject: [PATCH 1/2] Rename controllers to controller Signed-off-by: Stefan Prodan --- internal/{controllers => controller}/controllers_fuzzer_test.go | 0 internal/{controllers => controller}/database.go | 0 internal/{controllers => controller}/imagepolicy_controller.go | 0 .../{controllers => controller}/imagepolicy_controller_test.go | 0 .../{controllers => controller}/imagerepository_controller.go | 0 .../imagerepository_controller_test.go | 0 internal/{controllers => controller}/policy_test.go | 0 internal/{controllers => controller}/scan_test.go | 0 internal/{controllers => controller}/suite_test.go | 0 main.go | 2 +- 10 files changed, 1 insertion(+), 1 deletion(-) rename internal/{controllers => controller}/controllers_fuzzer_test.go (100%) rename internal/{controllers => controller}/database.go (100%) rename internal/{controllers => controller}/imagepolicy_controller.go (100%) rename internal/{controllers => controller}/imagepolicy_controller_test.go (100%) rename internal/{controllers => controller}/imagerepository_controller.go (100%) rename internal/{controllers => controller}/imagerepository_controller_test.go (100%) rename internal/{controllers => controller}/policy_test.go (100%) rename internal/{controllers => controller}/scan_test.go (100%) rename internal/{controllers => controller}/suite_test.go (100%) diff --git a/internal/controllers/controllers_fuzzer_test.go b/internal/controller/controllers_fuzzer_test.go similarity index 100% rename from internal/controllers/controllers_fuzzer_test.go rename to internal/controller/controllers_fuzzer_test.go diff --git a/internal/controllers/database.go b/internal/controller/database.go similarity index 100% rename from internal/controllers/database.go rename to internal/controller/database.go diff --git a/internal/controllers/imagepolicy_controller.go b/internal/controller/imagepolicy_controller.go similarity index 100% rename from internal/controllers/imagepolicy_controller.go rename to internal/controller/imagepolicy_controller.go diff --git a/internal/controllers/imagepolicy_controller_test.go b/internal/controller/imagepolicy_controller_test.go similarity index 100% rename from internal/controllers/imagepolicy_controller_test.go rename to internal/controller/imagepolicy_controller_test.go diff --git a/internal/controllers/imagerepository_controller.go b/internal/controller/imagerepository_controller.go similarity index 100% rename from internal/controllers/imagerepository_controller.go rename to internal/controller/imagerepository_controller.go diff --git a/internal/controllers/imagerepository_controller_test.go b/internal/controller/imagerepository_controller_test.go similarity index 100% rename from internal/controllers/imagerepository_controller_test.go rename to internal/controller/imagerepository_controller_test.go diff --git a/internal/controllers/policy_test.go b/internal/controller/policy_test.go similarity index 100% rename from internal/controllers/policy_test.go rename to internal/controller/policy_test.go diff --git a/internal/controllers/scan_test.go b/internal/controller/scan_test.go similarity index 100% rename from internal/controllers/scan_test.go rename to internal/controller/scan_test.go diff --git a/internal/controllers/suite_test.go b/internal/controller/suite_test.go similarity index 100% rename from internal/controllers/suite_test.go rename to internal/controller/suite_test.go diff --git a/main.go b/main.go index 1c565672..8223978b 100644 --- a/main.go +++ b/main.go @@ -48,7 +48,7 @@ import ( // +kubebuilder:scaffold:imports imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2" - "github.com/fluxcd/image-reflector-controller/internal/controllers" + "github.com/fluxcd/image-reflector-controller/internal/controller" "github.com/fluxcd/image-reflector-controller/internal/database" "github.com/fluxcd/image-reflector-controller/internal/features" ) From 041acac4ab927ba13a61763d19a3991e45006494 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Wed, 24 May 2023 11:02:45 +0300 Subject: [PATCH 2/2] Remove the tini supervisor Signed-off-by: Stefan Prodan --- Dockerfile | 7 ++++--- tests/fuzz/oss_fuzz_prebuild.sh | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 09b3d9a8..28f5f885 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,12 +32,13 @@ RUN xx-go build -trimpath -a -o image-reflector-controller main.go FROM alpine:3.18 -LABEL org.opencontainers.image.source="https://github.com/fluxcd/image-reflector-controller" +ARG TARGETPLATFORM -RUN apk add --no-cache ca-certificates tini +RUN apk --no-cache add ca-certificates \ + && update-ca-certificates COPY --from=builder /workspace/image-reflector-controller /usr/local/bin/ USER 65534:65534 -ENTRYPOINT [ "/sbin/tini", "--", "image-reflector-controller" ] +ENTRYPOINT [ "image-reflector-controller" ] diff --git a/tests/fuzz/oss_fuzz_prebuild.sh b/tests/fuzz/oss_fuzz_prebuild.sh index 73f0e20a..b32efd0a 100755 --- a/tests/fuzz/oss_fuzz_prebuild.sh +++ b/tests/fuzz/oss_fuzz_prebuild.sh @@ -21,5 +21,5 @@ set -euxo pipefail # Some tests requires embedded resources. Embedding does not allow # for traversing into ascending dirs, therefore we copy those contents here: -mkdir -p internal/controllers/testdata/crd -cp config/crd/bases/*.yaml internal/controllers/testdata/crd +mkdir -p internal/controller/testdata/crd +cp config/crd/bases/*.yaml internal/controller/testdata/crd