Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move controllers to internal/controllers #715

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ COPY vendor vendor
COPY api api
COPY api-hub api-hub
COPY cmd cmd
COPY controllers controllers
COPY docs.mk docs.mk
COPY internal internal

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ help: ## Display this help.
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) webhook paths="./api/..." output:webhook:artifacts:config=config/webhook
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./controllers" output:rbac:artifacts:config=config/rbac
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/controllers" output:rbac:artifacts:config=config/rbac
# Hub
$(CONTROLLER_GEN) crd paths="./api-hub/..." output:crd:artifacts:config=config/crd-hub/bases
$(CONTROLLER_GEN) webhook paths="./api-hub/..." output:webhook:artifacts:config=config/webhook-hub
$(CONTROLLER_GEN) \
rbac:roleName=manager-role \
paths="./controllers/hub" \
paths="controllers/imagestream_reconciler.go" \
paths="./internal/controllers/hub" \
paths="internal/controllers/imagestream_reconciler.go" \
output:rbac:artifacts:config=config/rbac-hub

.PHONY: generate
Expand Down
4 changes: 2 additions & 2 deletions cmd/manager-hub/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/rh-ecosystem-edge/kernel-module-management/api-hub/v1beta1"
"github.com/rh-ecosystem-edge/kernel-module-management/controllers"
"github.com/rh-ecosystem-edge/kernel-module-management/controllers/hub"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/auth"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/build"
buildocpbuild "github.com/rh-ecosystem-edge/kernel-module-management/internal/build/ocpbuild"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/cache"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/cluster"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/cmd"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/constants"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/controllers"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/controllers/hub"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/filter"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/manifestwork"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/metrics"
Expand Down
9 changes: 2 additions & 7 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ import (
buildv1 "github.com/openshift/api/build/v1"
imagev1 "github.com/openshift/api/image/v1"
kmmv1beta1 "github.com/rh-ecosystem-edge/kernel-module-management/api/v1beta1"
"github.com/rh-ecosystem-edge/kernel-module-management/controllers"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/auth"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/build"
buildocpbuild "github.com/rh-ecosystem-edge/kernel-module-management/internal/build/ocpbuild"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/cmd"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/config"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/constants"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/controllers"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/daemonset"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/filter"
"github.com/rh-ecosystem-edge/kernel-module-management/internal/metrics"
Expand Down Expand Up @@ -182,14 +182,9 @@ func main() {
cmd.FatalError(setupLogger, err, "unable to create controller", "name", controllers.ModuleNMCReconcilerName)
}

workerHelper := controllers.NewWorkerHelper(
client,
controllers.NewPodManager(client, workerImage, scheme),
)

ctx := ctrl.SetupSignalHandler()

if err = controllers.NewNodeModulesConfigReconciler(client, workerHelper).SetupWithManager(ctx, mgr); err != nil {
if err = controllers.NewNMCReconciler(client, scheme, workerImage).SetupWithManager(ctx, mgr); err != nil {
cmd.FatalError(setupLogger, err, "unable to create controller", "name", controllers.NodeModulesConfigReconcilerName)
}

Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading