Skip to content

Commit

Permalink
move controllers from controllers/ to internal/controller/ dir
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusfm committed May 8, 2023
1 parent a6f7a9a commit 7e2429c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cmd/manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ COPY go.sum go.sum
RUN go mod download

COPY cmd/manager/main.go cmd/manager/main.go
COPY api api/
COPY controllers controllers/
COPY pkg pkg/
COPY api/ api/
COPY internal/controller internal/controller
COPY pkg/ pkg/

RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/manager/main.go

Expand Down
12 changes: 5 additions & 7 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@ import (
"strings"
"time"

"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/undistro/zora/pkg/saas"

"go.uber.org/zap/zapcore"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/kubernetes"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

zorav1alpha1 "github.com/undistro/zora/api/zora/v1alpha1"
zoracontrollers "github.com/undistro/zora/controllers/zora"
zoracontroller "github.com/undistro/zora/internal/controller/zora"
"github.com/undistro/zora/pkg/saas"
//+kubebuilder:scaffold:imports
)

Expand Down Expand Up @@ -115,7 +114,7 @@ func main() {
onClusterScanDelete = saas.DeleteClusterScanHook(saasClient, mgr.GetClient())
}

if err = (&zoracontrollers.ClusterReconciler{
if err = (&zoracontroller.ClusterReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("cluster-controller"),
Expand All @@ -133,7 +132,7 @@ func main() {
os.Exit(1)
}

if err = (&zoracontrollers.ClusterScanReconciler{
if err = (&zoracontroller.ClusterScanReconciler{
Client: mgr.GetClient(),
K8sClient: kcli,
Scheme: mgr.GetScheme(),
Expand All @@ -149,7 +148,6 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "ClusterScan")
os.Exit(1)
}

//+kubebuilder:scaffold:builder

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7e2429c

Please sign in to comment.