Add the config parameter for chartmuseum URL 29/11229/1
authorsubhash kumar singh <subh.singh@samsung.com>
Fri, 26 May 2023 08:52:33 +0000 (08:52 +0000)
committersubhash kumar singh <subh.singh@samsung.com>
Fri, 26 May 2023 08:56:42 +0000 (08:56 +0000)
Added config parameter for chartmuseum URL.

Issue-ID: RIC-955
Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
Change-Id: Ifbab618f42abea6827f26b5d4cad23589b9d3acf

config/config-test.yaml
config/config.yaml
pkg/config/conf.go
pkg/onboard/onboarder.go

index 4b41e89..1057ad4 100644 (file)
@@ -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
index e8f7bbf..2146ed4 100644 (file)
@@ -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
index 6c54b2b..f0e2a63 100644 (file)
@@ -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) {
index 64b15f6..19cacc0 100644 (file)
@@ -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.