From ec21c4448b97cfe4c40bcfe147c30cd774397f81 Mon Sep 17 00:00:00 2001 From: danielsinai Date: Sun, 5 May 2024 15:57:55 +0300 Subject: [PATCH] fix: added the kind config to the resources at the start of the loop --- pkg/crd/crd.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/crd/crd.go b/pkg/crd/crd.go index 93d6bcc..90f5fac 100644 --- a/pkg/crd/crd.go +++ b/pkg/crd/crd.go @@ -304,10 +304,11 @@ func findMatchingCRDs(crds []v1.CustomResourceDefinition, pattern string) []v1.C return matchedCRDs } -func handleMatchingCRD(crds []v1.CustomResourceDefinition, pattern string, portConfig *port.IntegrationAppConfig, portClient *cli.PortClient) { - matchedCRDs := findMatchingCRDs(crds, pattern) +func handleMatchingCRD(crds []v1.CustomResourceDefinition, portConfig *port.IntegrationAppConfig, portClient *cli.PortClient) { + matchedCRDs := findMatchingCRDs(crds, portConfig.CRDSToDiscover) for _, crd := range matchedCRDs { + portConfig.Resources = append(portConfig.Resources, createKindConfigFromCRD(crd)) actions, bp, err := convertToPortSchema(crd) if err != nil { klog.Errorf("Error converting CRD to Port schemas: %s", err.Error()) @@ -362,5 +363,5 @@ func AutodiscoverCRDsToActions(portConfig *port.IntegrationAppConfig, apiExtensi return } - handleMatchingCRD(crds.Items, portConfig.CRDSToDiscover, portConfig, portClient) + handleMatchingCRD(crds.Items, portConfig, portClient) }