X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frestful%2Frestful.go;h=4e6f7a192241b8ce379b222998c8b8a32c035a86;hb=b74d93d5ad6c2340e291529ce03bbed43daeb2a5;hp=4e91b09c4f4e81e09e5c3966f519f1ae615c25c1;hpb=d25ee8c6c3027e65def77176aa08f06ba5500fe9;p=ric-plt%2Fricdms.git diff --git a/pkg/restful/restful.go b/pkg/restful/restful.go index 4e91b09..4e6f7a1 100644 --- a/pkg/restful/restful.go +++ b/pkg/restful/restful.go @@ -30,6 +30,7 @@ import ( ch "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/charts" dm "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/deploy" ph "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/health" + "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/models" po "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/onboard" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations" @@ -122,8 +123,14 @@ func (r *Restful) setupHandler() { api.ExperimentPostCustomOnboardHandler = experiment.PostCustomOnboardHandlerFunc(func(pcop experiment.PostCustomOnboardParams) middleware.Responder { ricdms.Logger.Debug("==> invoked custom onboarding") - defer pcop.Upfile.Close() - return r.rh.Onboarder.CustomOnboard(pcop.Upfile) + if pcop.Helmpkg == nil { + errString := "formdata not provided with key helmpkg" + return experiment.NewPostCustomOnboardInternalServerError().WithPayload(&models.ErrorMessage{ + ErrorMessage: &errString, + }) + } + defer pcop.Helmpkg.Close() + return r.rh.Onboarder.CustomOnboard(pcop.Helmpkg) }) api.ApplicationZipProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error {