From 0c0109a4bd56266f93d1eedc06ca6349e74a6cb5 Mon Sep 17 00:00:00 2001 From: Max Jonas Werner Date: Thu, 23 Mar 2023 18:35:20 +0100 Subject: [PATCH] move all controllers to `internal` package closes #499 Signed-off-by: Max Jonas Werner --- Dockerfile | 1 - {controllers => internal/controllers}/alert_controller.go | 0 {controllers => internal/controllers}/alert_controller_test.go | 0 {controllers => internal/controllers}/provider_controller.go | 0 .../controllers}/provider_controller_test.go | 0 {controllers => internal/controllers}/receiver_controller.go | 0 .../controllers}/receiver_controller_test.go | 0 {controllers => internal/controllers}/suite_test.go | 2 +- {controllers => internal/controllers}/testdata/gitrepo2.yaml | 0 {controllers => internal/controllers}/testdata/repo.yaml | 0 main.go | 2 +- 11 files changed, 2 insertions(+), 3 deletions(-) rename {controllers => internal/controllers}/alert_controller.go (100%) rename {controllers => internal/controllers}/alert_controller_test.go (100%) rename {controllers => internal/controllers}/provider_controller.go (100%) rename {controllers => internal/controllers}/provider_controller_test.go (100%) rename {controllers => internal/controllers}/receiver_controller.go (100%) rename {controllers => internal/controllers}/receiver_controller_test.go (100%) rename {controllers => internal/controllers}/suite_test.go (98%) rename {controllers => internal/controllers}/testdata/gitrepo2.yaml (100%) rename {controllers => internal/controllers}/testdata/repo.yaml (100%) diff --git a/Dockerfile b/Dockerfile index 61ab7d9e8..044a69821 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/alert_controller.go b/internal/controllers/alert_controller.go similarity index 100% rename from controllers/alert_controller.go rename to internal/controllers/alert_controller.go diff --git a/controllers/alert_controller_test.go b/internal/controllers/alert_controller_test.go similarity index 100% rename from controllers/alert_controller_test.go rename to internal/controllers/alert_controller_test.go diff --git a/controllers/provider_controller.go b/internal/controllers/provider_controller.go similarity index 100% rename from controllers/provider_controller.go rename to internal/controllers/provider_controller.go diff --git a/controllers/provider_controller_test.go b/internal/controllers/provider_controller_test.go similarity index 100% rename from controllers/provider_controller_test.go rename to internal/controllers/provider_controller_test.go diff --git a/controllers/receiver_controller.go b/internal/controllers/receiver_controller.go similarity index 100% rename from controllers/receiver_controller.go rename to internal/controllers/receiver_controller.go diff --git a/controllers/receiver_controller_test.go b/internal/controllers/receiver_controller_test.go similarity index 100% rename from controllers/receiver_controller_test.go rename to internal/controllers/receiver_controller_test.go diff --git a/controllers/suite_test.go b/internal/controllers/suite_test.go similarity index 98% rename from controllers/suite_test.go rename to internal/controllers/suite_test.go index 9c2302d3a..a224f84f3 100644 --- a/controllers/suite_test.go +++ b/internal/controllers/suite_test.go @@ -58,7 +58,7 @@ func TestMain(m *testing.M) { utilruntime.Must(apiv1b2.AddToScheme(scheme.Scheme)) testEnv = testenv.New(testenv.WithCRDPath( - filepath.Join("..", "config", "crd", "bases"), + filepath.Join("..", "..", "config", "crd", "bases"), )) k8sClient, err = client.New(testEnv.Config, client.Options{Scheme: scheme.Scheme}) diff --git a/controllers/testdata/gitrepo2.yaml b/internal/controllers/testdata/gitrepo2.yaml similarity index 100% rename from controllers/testdata/gitrepo2.yaml rename to internal/controllers/testdata/gitrepo2.yaml diff --git a/controllers/testdata/repo.yaml b/internal/controllers/testdata/repo.yaml similarity index 100% rename from controllers/testdata/repo.yaml rename to internal/controllers/testdata/repo.yaml diff --git a/main.go b/main.go index 017d91b82..07ebbeb73 100644 --- a/main.go +++ b/main.go @@ -44,7 +44,7 @@ import ( apiv1 "github.com/fluxcd/notification-controller/api/v1" apiv1b2 "github.com/fluxcd/notification-controller/api/v1beta2" - "github.com/fluxcd/notification-controller/controllers" + "github.com/fluxcd/notification-controller/internal/controllers" "github.com/fluxcd/notification-controller/internal/features" "github.com/fluxcd/notification-controller/internal/server" // +kubebuilder:scaffold:imports