From abeede43222b102449c44b051f43ea5d91cf7347 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Fri, 3 May 2019 14:10:44 +0100 Subject: [PATCH] dd --- cmd/manager/main.go | 4 ++++ pkg/controller/mobilesecurityserviceapp/controller.go | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 6b43d3bb..d228fb51 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -74,6 +74,10 @@ func main() { } //Create cmd Manager + //FIXME: We should not watch/cache all namespaces. However, the current version do not allow us pass the List of Namespaces. + // The impl to allow do it is done and merged in the master branch of the lib but not released in an stable version. + // See the commit with the solution here + // See the test with it solved as we need here mgr, err := manager.New(cfg, manager.Options{ Namespace: "", }) diff --git a/pkg/controller/mobilesecurityserviceapp/controller.go b/pkg/controller/mobilesecurityserviceapp/controller.go index b5aca55d..39114ad7 100644 --- a/pkg/controller/mobilesecurityserviceapp/controller.go +++ b/pkg/controller/mobilesecurityserviceapp/controller.go @@ -108,8 +108,12 @@ func (r *ReconcileMobileSecurityServiceApp) buildFactory(reqLogger logr.Logger, func (r *ReconcileMobileSecurityServiceApp) Reconcile(request reconcile.Request) (reconcile.Result, error) { reqLogger := log.WithValues("Request.Namespace", request.Namespace, "Request.Name", request.Name) reqLogger.Info("Reconciling MobileSecurityServiceApp") - - //Check if is a valid namespace + + // FIXME: Check if is a valid namespace + // We should not checked if the namespace is valid or not. It is an workaround since currently is not possible watch/cache a List of Namespaces + // The impl to allow do it is done and merged in the master branch of the lib but not released in an stable version. It should be removed when this feature be impl. + // See the commit with the solution here + // See the test with it solved as we need here if isValidNamespace, err:= utils.IsAppNamespaceValid(request.Namespace); err != nil || isValidNamespace == false { // Stop reconcile envVar, _ := utils.GetAppNamespaces();