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

Update only relevant CRs' owner references #2397

Merged
merged 1 commit into from
Jul 11, 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
44 changes: 33 additions & 11 deletions adapter/internal/operator/controllers/dp/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,67 +885,89 @@ func (apiReconciler *APIReconciler) getResolvedBackendsMapping(ctx context.Conte
// By employing these proxies, we prevent redundant owner reference updates for the same object due to the hierarchical structure of these functions.
func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForGQLRoute(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIForGQLRoute(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForHTTPRoute(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIForHTTPRoute(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForConfigMap(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForConfigMap(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForSecret(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForSecret(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForAuthentication(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForAuthentication(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForAPIPolicy(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForAPIPolicy(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForInterceptorService(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForInterceptorService(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForBackendJWT(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForBackendJWT(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForRateLimitPolicy(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForRateLimitPolicy(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForScope(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForScope(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

func (apiReconciler *APIReconciler) populateAPIReconcileRequestsForBackend(ctx context.Context, obj k8client.Object) []reconcile.Request {
requests := apiReconciler.getAPIsForBackend(ctx, obj)
apiReconciler.handleOwnerReference(ctx, obj, &requests)
if len(requests) > 0 {
apiReconciler.handleOwnerReference(ctx, obj, &requests)
}
return requests
}

Expand Down
Loading