Small refactoring

This commit is contained in:
Tomasz Sęk
2019-01-16 11:17:45 +01:00
parent 3aacf99536
commit dcafa71d67
3 changed files with 8 additions and 36 deletions
-10
View File
@@ -1,10 +0,0 @@
package controller
import (
"github.com/VirtusLab/jenkins-operator/pkg/controller/jenkins"
)
func init() {
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager.
AddToManagerFuncs = append(AddToManagerFuncs, jenkins.Add)
}
-18
View File
@@ -1,18 +0,0 @@
package controller
import (
"sigs.k8s.io/controller-runtime/pkg/manager"
)
// AddToManagerFuncs is a list of functions to add all Controllers to the Manager
var AddToManagerFuncs []func(manager manager.Manager, local, minikube bool) error
// AddToManager adds all Controllers to the Manager
func AddToManager(m manager.Manager, local, minikube bool) error {
for _, f := range AddToManagerFuncs {
if err := f(m, local, minikube); err != nil {
return err
}
}
return nil
}