Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix GMC crashes in e2e #395

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,9 @@ func (r *GMConnectorReconciler) deleteRecordedResource(key string, ctx context.C
}

func (r *GMConnectorReconciler) collectResourceStatus(graph *mcv1alpha3.GMConnector, ctx context.Context) error {
if graph == nil || len(graph.Status.Annotations) == 0 {
return errors.New("graph is empty or no annotations")
}
var totalCnt uint = 0
var readyCnt uint = 0
for resName := range graph.Status.Annotations {
Expand Down Expand Up @@ -880,6 +883,12 @@ func (r *GMConnectorReconciler) SetupWithManager(mgr ctrl.Manager) error {
// Predicate to only trigger on status changes for Deployment
deploymentFilter := predicate.Funcs{
UpdateFunc: isDeploymentStatusChanged,
//ignore create and delete events, otherwise it will trigger the nested reconcile which is meaningless
CreateFunc: func(e event.CreateEvent) bool {
return false
}, DeleteFunc: func(e event.DeleteEvent) bool {
return false
},
}

return ctrl.NewControllerManagedBy(mgr).
Expand Down
Loading