From 1c934357a00869cc5c538c0b43509f6e2f08ed68 Mon Sep 17 00:00:00 2001 From: Shivanshu Raj Shrivastava Date: Fri, 12 Nov 2021 19:47:09 +0530 Subject: [PATCH] moved to internal package and added alias.go --- Makefile | 2 +- .../src/developer/providers/v1.0-to-v1.1.md | 1 + exp/controllers/alias.go | 41 +++++++++++++++++++ exp/internal/controllers/doc.go | 18 ++++++++ .../controllers/machinepool_controller.go | 0 .../machinepool_controller_noderef.go | 0 .../machinepool_controller_noderef_test.go | 0 .../machinepool_controller_phases.go | 0 .../machinepool_controller_phases_test.go | 0 .../machinepool_controller_test.go | 0 exp/{ => internal}/controllers/suite_test.go | 0 11 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 exp/controllers/alias.go create mode 100644 exp/internal/controllers/doc.go rename exp/{ => internal}/controllers/machinepool_controller.go (100%) rename exp/{ => internal}/controllers/machinepool_controller_noderef.go (100%) rename exp/{ => internal}/controllers/machinepool_controller_noderef_test.go (100%) rename exp/{ => internal}/controllers/machinepool_controller_phases.go (100%) rename exp/{ => internal}/controllers/machinepool_controller_phases_test.go (100%) rename exp/{ => internal}/controllers/machinepool_controller_test.go (100%) rename exp/{ => internal}/controllers/suite_test.go (100%) diff --git a/Makefile b/Makefile index 269ec73a6f22..39253733c8e0 100644 --- a/Makefile +++ b/Makefile @@ -367,7 +367,7 @@ generate-manifests-core: $(CONTROLLER_GEN) $(KUSTOMIZE) paths=./controllers/... \ paths=./webhooks/... \ paths=./$(EXP_DIR)/api/... \ - paths=./$(EXP_DIR)/controllers/... \ + paths=./$(EXP_DIR)/internal/controllers/... \ paths=./$(EXP_DIR)/addons/api/... \ paths=./$(EXP_DIR)/addons/internal/controllers/... \ crd:crdVersions=v1 \ diff --git a/docs/book/src/developer/providers/v1.0-to-v1.1.md b/docs/book/src/developer/providers/v1.0-to-v1.1.md index ab23637e091a..bdcddbec36f7 100644 --- a/docs/book/src/developer/providers/v1.0-to-v1.1.md +++ b/docs/book/src/developer/providers/v1.0-to-v1.1.md @@ -36,6 +36,7 @@ are kept in sync with the versions used by `sigs.k8s.io/controller-runtime`. * [exp/addons/controllers](https://github.com/kubernetes-sigs/cluster-api/pull/5639) * [test/infrastructure/docker/controllers](https://github.com/kubernetes-sigs/cluster-api/pull/5595) * [test/infrastructure/docker/exp/controllers](https://github.com/kubernetes-sigs/cluster-api/pull/5690) + * [exp/controllers](https://github.com/kubernetes-sigs/cluster-api/pull/5651) ### Other diff --git a/exp/controllers/alias.go b/exp/controllers/alias.go new file mode 100644 index 000000000000..2c6228bba376 --- /dev/null +++ b/exp/controllers/alias.go @@ -0,0 +1,41 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package controllers + +import ( + "context" + + machinepool "sigs.k8s.io/cluster-api/exp/internal/controllers" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" +) + +// MachinePoolReconciler reconciles a MachinePool object. +type MachinePoolReconciler struct { + Client client.Client + + // WatchFilterValue is the label value used to filter events prior to reconciliation. + WatchFilterValue string +} + +func (r *MachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { + return (&machinepool.MachinePoolReconciler{ + Client: r.Client, + WatchFilterValue: r.WatchFilterValue, + }).SetupWithManager(ctx, mgr, options) +} diff --git a/exp/internal/controllers/doc.go b/exp/internal/controllers/doc.go new file mode 100644 index 000000000000..a58a55ea32f8 --- /dev/null +++ b/exp/internal/controllers/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package controllers implements experimental controllers. +package controllers diff --git a/exp/controllers/machinepool_controller.go b/exp/internal/controllers/machinepool_controller.go similarity index 100% rename from exp/controllers/machinepool_controller.go rename to exp/internal/controllers/machinepool_controller.go diff --git a/exp/controllers/machinepool_controller_noderef.go b/exp/internal/controllers/machinepool_controller_noderef.go similarity index 100% rename from exp/controllers/machinepool_controller_noderef.go rename to exp/internal/controllers/machinepool_controller_noderef.go diff --git a/exp/controllers/machinepool_controller_noderef_test.go b/exp/internal/controllers/machinepool_controller_noderef_test.go similarity index 100% rename from exp/controllers/machinepool_controller_noderef_test.go rename to exp/internal/controllers/machinepool_controller_noderef_test.go diff --git a/exp/controllers/machinepool_controller_phases.go b/exp/internal/controllers/machinepool_controller_phases.go similarity index 100% rename from exp/controllers/machinepool_controller_phases.go rename to exp/internal/controllers/machinepool_controller_phases.go diff --git a/exp/controllers/machinepool_controller_phases_test.go b/exp/internal/controllers/machinepool_controller_phases_test.go similarity index 100% rename from exp/controllers/machinepool_controller_phases_test.go rename to exp/internal/controllers/machinepool_controller_phases_test.go diff --git a/exp/controllers/machinepool_controller_test.go b/exp/internal/controllers/machinepool_controller_test.go similarity index 100% rename from exp/controllers/machinepool_controller_test.go rename to exp/internal/controllers/machinepool_controller_test.go diff --git a/exp/controllers/suite_test.go b/exp/internal/controllers/suite_test.go similarity index 100% rename from exp/controllers/suite_test.go rename to exp/internal/controllers/suite_test.go