From 2553f6c48a9a7b05b80926939ec9806729338e90 Mon Sep 17 00:00:00 2001 From: Tharsanan1 Date: Tue, 8 Oct 2024 13:07:30 +0530 Subject: [PATCH] Fix helm upgrade command deleting HttpRoutes --- adapter/internal/operator/controllers/dp/api_controller.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adapter/internal/operator/controllers/dp/api_controller.go b/adapter/internal/operator/controllers/dp/api_controller.go index 140d23cf2..431fed99e 100644 --- a/adapter/internal/operator/controllers/dp/api_controller.go +++ b/adapter/internal/operator/controllers/dp/api_controller.go @@ -2819,6 +2819,9 @@ func prepareOwnerReference(apiItems []dpv1alpha3.API) []metav1.OwnerReference { ownerReferences := []metav1.OwnerReference{} uidMap := make(map[string]bool) for _, ref := range apiItems { + if ref.Spec.SystemAPI { + continue + } if _, exists := uidMap[string(ref.UID)]; !exists { ownerReferences = append(ownerReferences, metav1.OwnerReference{ APIVersion: ref.APIVersion,