From 4f411bacefec35c9a51e078175668aa97a398477 Mon Sep 17 00:00:00 2001 From: Konrad Bańka Date: Tue, 7 Jan 2020 15:33:04 +0100 Subject: Instantiate infra_workload based on vf-module-*-ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deprecate k8s-rb-definition-* parameters from sdnc_directives in favor of vf-module-*-id that are used by newer artifact broker. Issue-ID: MULTICLOUD-836 Signed-off-by: Konrad Bańka Change-Id: I26ae16bd53ced56ae11523584f900a102f6e0bb9 --- src/k8splugin/api/brokerhandler.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/k8splugin/api/brokerhandler.go') diff --git a/src/k8splugin/api/brokerhandler.go b/src/k8splugin/api/brokerhandler.go index b377baf1..7671db44 100644 --- a/src/k8splugin/api/brokerhandler.go +++ b/src/k8splugin/api/brokerhandler.go @@ -134,15 +134,13 @@ func (b brokerInstanceHandler) createHandler(w http.ResponseWriter, r *http.Requ return } - rbName := req.getAttributeValue(req.SDNCDirectives, "k8s-rb-definition-name") - if rbName == "" { - http.Error(w, "k8s-rb-definition-name is missing from sdnc-directives", http.StatusBadRequest) + if req.VFModuleModelInvariantID == "" { + http.Error(w, "vf-module-model-invariant-id is empty", http.StatusBadRequest) return } - rbVersion := req.getAttributeValue(req.SDNCDirectives, "k8s-rb-definition-version") - if rbVersion == "" { - http.Error(w, "k8s-rb-definition-version is missing from sdnc-directives", http.StatusBadRequest) + if req.VFModuleModelVersionID == "" { + http.Error(w, "vf-module-model-version-id is empty", http.StatusBadRequest) return } @@ -160,8 +158,8 @@ func (b brokerInstanceHandler) createHandler(w http.ResponseWriter, r *http.Requ // Setup the resource parameters for making the request var instReq app.InstanceRequest - instReq.RBName = rbName - instReq.RBVersion = rbVersion + instReq.RBName = req.VFModuleModelInvariantID + instReq.RBVersion = req.VFModuleModelVersionID instReq.ProfileName = profileName instReq.CloudRegion = cloudRegion instReq.Labels = map[string]string{ -- cgit 1.2.3-korg