Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Commit

Permalink
dd
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed May 3, 2019
1 parent a7c7fd2 commit abeede4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/kubernetes-sigs/controller-runtime/commit/fc804a411c06919561edbcb0453601c436556613>
// See the test with it solved as we need here <https://github.com/kubernetes-sigs/controller-runtime/blob/68ae79ea094aab567d78d7d8596accac2dc27fd0/pkg/manager/example_test.go#L59>
mgr, err := manager.New(cfg, manager.Options{
Namespace: "",
})
Expand Down
8 changes: 6 additions & 2 deletions pkg/controller/mobilesecurityserviceapp/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/kubernetes-sigs/controller-runtime/commit/fc804a411c06919561edbcb0453601c436556613>
// See the test with it solved as we need here <https://github.com/kubernetes-sigs/controller-runtime/blob/68ae79ea094aab567d78d7d8596accac2dc27fd0/pkg/manager/example_test.go#L59>
if isValidNamespace, err:= utils.IsAppNamespaceValid(request.Namespace); err != nil || isValidNamespace == false {
// Stop reconcile
envVar, _ := utils.GetAppNamespaces();
Expand Down

0 comments on commit abeede4

Please sign in to comment.