Skip to content

Commit

Permalink
fix: added the kind config to the resources at the start of the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsinai committed May 5, 2024
1 parent e8cf5e7 commit ec21c44
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/crd/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -362,5 +363,5 @@ func AutodiscoverCRDsToActions(portConfig *port.IntegrationAppConfig, apiExtensi
return
}

handleMatchingCRD(crds.Items, portConfig.CRDSToDiscover, portConfig, portClient)
handleMatchingCRD(crds.Items, portConfig, portClient)
}

0 comments on commit ec21c44

Please sign in to comment.