From 8ac63a55e676ca5131974f583919c8278e629485 Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Fri, 26 May 2023 08:52:33 +0000 Subject: [PATCH] Add the config parameter for chartmuseum URL Added config parameter for chartmuseum URL. Issue-ID: RIC-955 Signed-off-by: subhash kumar singh Change-Id: Ifbab618f42abea6827f26b5d4cad23589b9d3acf --- config/config-test.yaml | 5 +++-- config/config.yaml | 3 ++- pkg/config/conf.go | 1 + pkg/onboard/onboarder.go | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/config-test.yaml b/config/config-test.yaml index 4b41e89..1057ad4 100644 --- a/config/config-test.yaml +++ b/config/config-test.yaml @@ -15,8 +15,9 @@ log-level: debug onborder-url: "http://127.0.0.1:9191" mock-server: "127.0.0.1:9191" -getCharts-url: "http://127.0.0.1:9191" +getCharts-url: "http://127.0.0.1:9191/helmrepo/api/charts" download-charts-url-format: "http://127.0.0.1:9191/helmrepo/charts/%s-%s.tgz" getCharts-by-name-url: "http://127.0.0.1:9191/helmrepo/api/charts/%s" getCharts-by-name-and-version-url: "http://127.0.0.1:9191/helmrepo/api/charts/%s/%s" -getXappHealth-url: "http://127.0.0.1:9191/ric/v1/health/alive/%s/%s" \ No newline at end of file +getXappHealth-url: "http://127.0.0.1:9191/ric/v1/health/alive/%s/%s" +customOnboard-url: "http://127.0.0.1:37019/api/charts" \ No newline at end of file diff --git a/config/config.yaml b/config/config.yaml index e8f7bbf..2146ed4 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -18,4 +18,5 @@ getCharts-url: "http://service-ricplt-xapp-onboarder-http.ricplt:8080/api/charts download-charts-url-format: "http://service-ricplt-xapp-onboarder-http.ricplt:8080/charts/%s-%s.tgz" getCharts-by-name-url: "http://service-ricplt-xapp-onboarder-http:8080/api/charts/%s" getCharts-by-name-and-version-url: "http://service-ricplt-xapp-onboarder-http:8080/api/charts/%s/%s" -getXappHealth-url: "http://service-ricxapp-%s-http.%s:8080/ric/v1/health/alive" \ No newline at end of file +getXappHealth-url: "http://service-ricxapp-%s-http.%s:8080/ric/v1/health/alive" +customOnboard-url: "http://service-ricplt-xapp-onboarder-http.ricplt:8080/api/charts" \ No newline at end of file diff --git a/pkg/config/conf.go b/pkg/config/conf.go index 6c54b2b..f0e2a63 100644 --- a/pkg/config/conf.go +++ b/pkg/config/conf.go @@ -36,6 +36,7 @@ type Conf struct { DownloadChartURLFormat string `yaml:"download-charts-url-format"` MockServer string `yaml:"mock-server"` GETxAPPHealthURL string `yaml:"getXappHealth-url"` + CustomOnboardURL string `yaml:"customOnboard-url"` } func ReadConfiguration(configFile string) (c *Conf, err error) { diff --git a/pkg/onboard/onboarder.go b/pkg/onboard/onboarder.go index 64b15f6..19cacc0 100644 --- a/pkg/onboard/onboarder.go +++ b/pkg/onboard/onboarder.go @@ -75,7 +75,7 @@ func (o *Onboarder) Onboard(descriptor *models.Descriptor) middleware.Responder // onboard provided helm chart func (o *Onboarder) CustomOnboard(reader io.Reader) middleware.Responder { ricdms.Logger.Debug("onboarder received req to onboard") - resp, err := http.Post("http://service-ricplt-xapp-onboarder-http.ricplt:8080/api/charts", "application/x-www-form-urlencoded", reader) + resp, err := http.Post(ricdms.Config.CustomOnboardURL, "application/x-www-form-urlencoded", reader) if err != nil { ricdms.Logger.Error("err received while onboarding chart to chartmuseum: %v", err) // TODO: introcuce error in in swagger to handle the error cases. -- 2.16.6