From fb92b2cb5a6e44d952fdb4f26a448a12faafd8e6 Mon Sep 17 00:00:00 2001 From: Sanskar Jaiswal Date: Mon, 27 Mar 2023 22:08:40 +0530 Subject: [PATCH] move `controllers` to `internal/controllers` Signed-off-by: Sanskar Jaiswal --- Dockerfile | 1 - .../controllers}/controllers_fuzzer_test.go | 0 {controllers => internal/controllers}/database.go | 0 {controllers => internal/controllers}/imagepolicy_controller.go | 0 .../controllers}/imagepolicy_controller_test.go | 0 .../controllers}/imagerepository_controller.go | 0 .../controllers}/imagerepository_controller_test.go | 0 {controllers => internal/controllers}/policy_test.go | 0 {controllers => internal/controllers}/scan_test.go | 0 {controllers => internal/controllers}/suite_test.go | 2 +- main.go | 2 +- 11 files changed, 2 insertions(+), 3 deletions(-) rename {controllers => internal/controllers}/controllers_fuzzer_test.go (100%) rename {controllers => internal/controllers}/database.go (100%) rename {controllers => internal/controllers}/imagepolicy_controller.go (100%) rename {controllers => internal/controllers}/imagepolicy_controller_test.go (100%) rename {controllers => internal/controllers}/imagerepository_controller.go (100%) rename {controllers => internal/controllers}/imagerepository_controller_test.go (100%) rename {controllers => internal/controllers}/policy_test.go (100%) rename {controllers => internal/controllers}/scan_test.go (100%) rename {controllers => internal/controllers}/suite_test.go (99%) diff --git a/Dockerfile b/Dockerfile index 646aeaed..123e3e74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,6 @@ RUN go mod download # copy source code COPY main.go main.go -COPY controllers/ controllers/ COPY internal/ internal/ # build diff --git a/controllers/controllers_fuzzer_test.go b/internal/controllers/controllers_fuzzer_test.go similarity index 100% rename from controllers/controllers_fuzzer_test.go rename to internal/controllers/controllers_fuzzer_test.go diff --git a/controllers/database.go b/internal/controllers/database.go similarity index 100% rename from controllers/database.go rename to internal/controllers/database.go diff --git a/controllers/imagepolicy_controller.go b/internal/controllers/imagepolicy_controller.go similarity index 100% rename from controllers/imagepolicy_controller.go rename to internal/controllers/imagepolicy_controller.go diff --git a/controllers/imagepolicy_controller_test.go b/internal/controllers/imagepolicy_controller_test.go similarity index 100% rename from controllers/imagepolicy_controller_test.go rename to internal/controllers/imagepolicy_controller_test.go diff --git a/controllers/imagerepository_controller.go b/internal/controllers/imagerepository_controller.go similarity index 100% rename from controllers/imagerepository_controller.go rename to internal/controllers/imagerepository_controller.go diff --git a/controllers/imagerepository_controller_test.go b/internal/controllers/imagerepository_controller_test.go similarity index 100% rename from controllers/imagerepository_controller_test.go rename to internal/controllers/imagerepository_controller_test.go diff --git a/controllers/policy_test.go b/internal/controllers/policy_test.go similarity index 100% rename from controllers/policy_test.go rename to internal/controllers/policy_test.go diff --git a/controllers/scan_test.go b/internal/controllers/scan_test.go similarity index 100% rename from controllers/scan_test.go rename to internal/controllers/scan_test.go diff --git a/controllers/suite_test.go b/internal/controllers/suite_test.go similarity index 99% rename from controllers/suite_test.go rename to internal/controllers/suite_test.go index 492ba00f..171fa1d5 100644 --- a/controllers/suite_test.go +++ b/internal/controllers/suite_test.go @@ -66,7 +66,7 @@ func TestMain(m *testing.M) { utilruntime.Must(imagev1.AddToScheme(scheme.Scheme)) - testEnv = testenv.New(testenv.WithCRDPath(filepath.Join("..", "config", "crd", "bases"))) + testEnv = testenv.New(testenv.WithCRDPath(filepath.Join("..", "..", "config", "crd", "bases"))) var err error var badgerDir string diff --git a/main.go b/main.go index 6c3d2571..f09a0f8a 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ import ( // +kubebuilder:scaffold:imports imagev1 "github.com/fluxcd/image-reflector-controller/api/v1beta2" - "github.com/fluxcd/image-reflector-controller/controllers" + "github.com/fluxcd/image-reflector-controller/internal/controllers" "github.com/fluxcd/image-reflector-controller/internal/database" "github.com/fluxcd/image-reflector-controller/internal/features" )