From b0d960af6287a3da8744af704b89daa5e23f0b54 Mon Sep 17 00:00:00 2001 From: DenisGNoonan Date: Thu, 16 Nov 2023 15:58:51 +0000 Subject: [PATCH] NONRTRIC-946:Remove hard-coded kong domain Issue-ID: NONRTRIC-946 Signed-off-by: DenisGNoonan Change-Id: Ib298370047713d9e51f3279a92fd9077658eec0b --- capifcore/internal/discoverservice/discoverservice.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/capifcore/internal/discoverservice/discoverservice.go b/capifcore/internal/discoverservice/discoverservice.go index 511dbe0..82b5972 100644 --- a/capifcore/internal/discoverservice/discoverservice.go +++ b/capifcore/internal/discoverservice/discoverservice.go @@ -3,6 +3,7 @@ // O-RAN-SC // %% // Copyright (C) 2022: Nordix Foundation +// Copyright (C) 2023: OpenInfra Foundation Europe. // %% // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -48,18 +49,12 @@ func (ds *DiscoverService) GetAllServiceAPIs(ctx echo.Context, params discoverap if allApis == nil { return sendCoreError(ctx, http.StatusNotFound, fmt.Sprintf("Invoker %s not registered", params.ApiInvokerId)) } + filteredApis := []publishapi.ServiceAPIDescription{} - gatewayDomain := "r1-expo-func-aef" for _, api := range *allApis { - if !matchesFilter(api, params) { - continue - } - profiles := *api.AefProfiles - for i, profile := range profiles { - profile.DomainName = &gatewayDomain // Hardcoded for now. Should be provided through some other mechanism. - profiles[i] = profile + if matchesFilter(api, params) { + filteredApis = append(filteredApis, api) } - filteredApis = append(filteredApis, api) } discoveredApis := discoverapi.DiscoveredAPIs{ ServiceAPIDescriptions: &filteredApis, -- 2.16.6