Skip to content

Commit

Permalink
fix: configure runtime controller with namespace event filter (#1146)
Browse files Browse the repository at this point in the history
* fix: configure runtime controller with namespace event filter
* Increase memory limit to 1Gi

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Oct 18, 2021
1 parent 0667196 commit 06aa35c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.38.0-360.next
name: eclipse-che-preview-openshift.v7.38.0-363.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1162,7 +1162,7 @@ spec:
resources:
limits:
cpu: 500m
memory: 256Mi
memory: 1Gi
requests:
cpu: 100m
memory: 64Mi
Expand Down Expand Up @@ -1414,4 +1414,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.38.0-360.next
version: 7.38.0-363.next
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-kubernetes.v7.38.0-321.next
name: eclipse-che-preview-kubernetes.v7.38.0-324.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1151,7 +1151,7 @@ spec:
resources:
limits:
cpu: 500m
memory: 256Mi
memory: 1Gi
requests:
cpu: 100m
memory: 64Mi
Expand Down Expand Up @@ -1381,4 +1381,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.38.0-321.next
version: 7.38.0-324.next
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.38.0-328.next
name: eclipse-che-preview-openshift.v7.38.0-331.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1162,7 +1162,7 @@ spec:
resources:
limits:
cpu: 500m
memory: 256Mi
memory: 1Gi
requests:
cpu: 100m
memory: 64Mi
Expand Down Expand Up @@ -1414,4 +1414,4 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.38.0-328.next
version: 7.38.0-331.next
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ spec:
resources:
limits:
cpu: 500m
memory: 256Mi
memory: 1Gi
requests:
cpu: 100m
memory: 64Mi
Expand Down
10 changes: 5 additions & 5 deletions controllers/che/checluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (r *CheClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
return []ctrl.Request{}
}

contollerBuilder := ctrl.NewControllerManagedBy(mgr).
controllerBuilder := ctrl.NewControllerManagedBy(mgr).
// Watch for changes to primary resource CheCluster
Watches(&source.Kind{Type: &orgv1.CheCluster{}}, &handler.EnqueueRequestForObject{}).
// Watch for changes to secondary resources and requeue the owner CheCluster
Expand Down Expand Up @@ -201,22 +201,22 @@ func (r *CheClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
)

if isOpenShift {
contollerBuilder = contollerBuilder.Watches(&source.Kind{Type: &routev1.Route{}}, &handler.EnqueueRequestForOwner{
controllerBuilder = controllerBuilder.Watches(&source.Kind{Type: &routev1.Route{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &orgv1.CheCluster{},
})
} else {
contollerBuilder = contollerBuilder.Watches(&source.Kind{Type: &networking.Ingress{}}, &handler.EnqueueRequestForOwner{
controllerBuilder = controllerBuilder.Watches(&source.Kind{Type: &networking.Ingress{}}, &handler.EnqueueRequestForOwner{
IsController: true,
OwnerType: &orgv1.CheCluster{},
})
}

if r.namespace != "" {
contollerBuilder.WithEventFilter(util.InNamespaceEventFilter(r.namespace))
controllerBuilder = controllerBuilder.WithEventFilter(util.InNamespaceEventFilter(r.namespace))
}

return contollerBuilder.
return controllerBuilder.
For(&orgv1.CheCluster{}).
Complete(r)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (r *ReconcileCheClusterBackup) SetupWithManager(mgr ctrl.Manager) error {
Watches(&source.Kind{Type: &chev1.CheClusterBackup{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(backupCRPredicate))

if r.namespace != "" {
bldr.WithEventFilter(util.InNamespaceEventFilter(r.namespace))
bldr = bldr.WithEventFilter(util.InNamespaceEventFilter(r.namespace))
}

return bldr.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (r *ReconcileCheClusterRestore) SetupWithManager(mgr ctrl.Manager) error {
Watches(&source.Kind{Type: &chev1.CheClusterRestore{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(restoreCRPredicate))

if r.namespace != "" {
bldr.WithEventFilter(util.InNamespaceEventFilter(r.namespace))
bldr = bldr.WithEventFilter(util.InNamespaceEventFilter(r.namespace))
}

return bldr.
Expand Down

0 comments on commit 06aa35c

Please sign in to comment.