Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakknutsen committed Sep 4, 2024
1 parent f3c1d97 commit 27b984e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions controllers/routingctrl/reconcile_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,20 @@ func (r *Controller) createRoutingResources(ctx context.Context, target *unstruc
return fmt.Errorf("could not get domain: %w", errDomain)
}

targetPublicHosts := []string{}
targetExternalHosts := []string{}
var errSvcExport []error

var targetPublicHosts []string

var targetExternalHosts []string

for i := range exportedServices {
servicePublicHosts, serviceExternalHosts, errExport := r.exportService(ctx, target, &exportedServices[i], domain)
if errExport != nil {
errSvcExport = append(errSvcExport, errExport)

continue
}

targetPublicHosts = append(targetPublicHosts, servicePublicHosts...)
targetExternalHosts = append(targetExternalHosts, serviceExternalHosts...)
}
Expand All @@ -71,12 +75,11 @@ func (r *Controller) createRoutingResources(ctx context.Context, target *unstruc
return r.propagateHostsToWatchedCR(ctx, target, targetPublicHosts, targetExternalHosts)
}

func (r *Controller) exportService(ctx context.Context, target *unstructured.Unstructured, exportedSvc *corev1.Service, domain string) ([]string, []string, error) {
//nolint:nonamedreturns //reason make up your mind, nonamedreturns vs gocritic
func (r *Controller) exportService(ctx context.Context, target *unstructured.Unstructured,
exportedSvc *corev1.Service, domain string) (publicHosts, externalHosts []string, err error) {
exportModes := r.extractExportModes(target)

externalHosts := []string{}
publicHosts := []string{}

// To establish ownership for watched component
ownershipLabels := append(labels.AsOwner(target), labels.AppManagedBy("odh-routing-controller"))

Expand Down

0 comments on commit 27b984e

Please sign in to comment.