Skip to content

Commit

Permalink
update: remove ingresscontroller from owns/watches
Browse files Browse the repository at this point in the history
Signed-off-by: Wen Zhou <[email protected]>
  • Loading branch information
zdtsw committed Oct 31, 2024
1 parent 2c98210 commit 7e79f0f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions controllers/datasciencecluster/datasciencecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,25 +532,20 @@ func (r *DataScienceClusterReconciler) SetupWithManager(ctx context.Context, mgr
}),
builder.WithPredicates(argoWorkflowCRDPredicates),
).
Watches( // ingresscontroller
&networkingv1.Ingress{},
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, a client.Object) []reconcile.Request {
return r.watchDefaultIngressSecret(ctx, a)
}),
).
Watches( // ingress
&configv1.Ingress{},
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, a client.Object) []reconcile.Request {
return r.watchIngressResources(ctx, a)
}),

Check warning on line 539 in controllers/datasciencecluster/datasciencecluster_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/datasciencecluster/datasciencecluster_controller.go#L537-L539

Added lines #L537 - L539 were not covered by tests
builder.WithPredicates(updatePredicates),
builder.WithPredicates(generalUpdatePredicates),
).
Watches(
&corev1.Secret{},
handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, a client.Object) []reconcile.Request {
return r.watchDefaultIngressSecret(ctx, a)
}),
builder.WithPredicates(defaultIngressCertSecretPredicates)).
builder.WithPredicates(defaultIngressCertSecretPredicates),
).
// this predicates prevents meaningless reconciliations from being triggered
WithEventFilter(predicate.Or(predicate.GenerationChangedPredicate{}, predicate.LabelChangedPredicate{})).
Complete(r)
Expand Down Expand Up @@ -659,7 +654,7 @@ func (r *DataScienceClusterReconciler) watchIngressResources(ctx context.Context
}}

Check warning on line 654 in controllers/datasciencecluster/datasciencecluster_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/datasciencecluster/datasciencecluster_controller.go#L647-L654

Added lines #L647 - L654 were not covered by tests
}

var updatePredicates = predicate.Funcs{
var generalUpdatePredicates = predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
return true
},

Check warning on line 660 in controllers/datasciencecluster/datasciencecluster_controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/datasciencecluster/datasciencecluster_controller.go#L658-L660

Added lines #L658 - L660 were not covered by tests
Expand Down

0 comments on commit 7e79f0f

Please sign in to comment.