From 31a1fc0ad917afc5dcfb0614b8313734b8f4911a Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Tue, 5 Jan 2021 14:42:00 -0600 Subject: [PATCH] Move go packages to vino/pkg This organizes our go packages under a "pkg/" directory, which will help keep them separated from other things (tools, config, ...), especially as the number of packages grows. It also brings vino in line with conventions used by sip, airshipctl, and the k8s community. Change-Id: Ieea0cdde7eeea9400384ca45bb5830322bbe0a82 --- Dockerfile | 4 +--- main.go | 4 ++-- {api => pkg/api}/v1/conditions.go | 0 {api => pkg/api}/v1/groupversion_info.go | 0 {api => pkg/api}/v1/vino_types.go | 0 {api => pkg/api}/v1/zz_generated.deepcopy.go | 0 {controllers => pkg/controllers}/suite_test.go | 2 +- {controllers => pkg/controllers}/vino_controller.go | 2 +- 8 files changed, 5 insertions(+), 7 deletions(-) rename {api => pkg/api}/v1/conditions.go (100%) rename {api => pkg/api}/v1/groupversion_info.go (100%) rename {api => pkg/api}/v1/vino_types.go (100%) rename {api => pkg/api}/v1/zz_generated.deepcopy.go (100%) rename {controllers => pkg/controllers}/suite_test.go (98%) rename {controllers => pkg/controllers}/vino_controller.go (99%) diff --git a/Dockerfile b/Dockerfile index 1ad6c18..000b4fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,7 @@ RUN go mod download # Copy the go source COPY main.go main.go -COPY api api/ -COPY controllers controllers/ - +COPY pkg pkg/ # Build RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go diff --git a/main.go b/main.go index 5d10503..e83a276 100644 --- a/main.go +++ b/main.go @@ -29,8 +29,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log/zap" - vinov1 "vino/api/v1" - "vino/controllers" + vinov1 "vino/pkg/api/v1" + "vino/pkg/controllers" // +kubebuilder:scaffold:imports ) diff --git a/api/v1/conditions.go b/pkg/api/v1/conditions.go similarity index 100% rename from api/v1/conditions.go rename to pkg/api/v1/conditions.go diff --git a/api/v1/groupversion_info.go b/pkg/api/v1/groupversion_info.go similarity index 100% rename from api/v1/groupversion_info.go rename to pkg/api/v1/groupversion_info.go diff --git a/api/v1/vino_types.go b/pkg/api/v1/vino_types.go similarity index 100% rename from api/v1/vino_types.go rename to pkg/api/v1/vino_types.go diff --git a/api/v1/zz_generated.deepcopy.go b/pkg/api/v1/zz_generated.deepcopy.go similarity index 100% rename from api/v1/zz_generated.deepcopy.go rename to pkg/api/v1/zz_generated.deepcopy.go diff --git a/controllers/suite_test.go b/pkg/controllers/suite_test.go similarity index 98% rename from controllers/suite_test.go rename to pkg/controllers/suite_test.go index 403681f..928e966 100644 --- a/controllers/suite_test.go +++ b/pkg/controllers/suite_test.go @@ -30,7 +30,7 @@ import ( logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" - airshipv1 "vino/api/v1" + airshipv1 "vino/pkg/api/v1" // +kubebuilder:scaffold:imports ) diff --git a/controllers/vino_controller.go b/pkg/controllers/vino_controller.go similarity index 99% rename from controllers/vino_controller.go rename to pkg/controllers/vino_controller.go index 5d40911..22c6c7f 100644 --- a/controllers/vino_controller.go +++ b/pkg/controllers/vino_controller.go @@ -35,7 +35,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/yaml" - vinov1 "vino/api/v1" + vinov1 "vino/pkg/api/v1" ) const (