From cf79276e2b633211d9a0befcb0e978dea447a9cf Mon Sep 17 00:00:00 2001 From: Konrad Bańka Date: Fri, 4 Sep 2020 14:44:45 +0200 Subject: Provide capability to specify release-name during instantiation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow release-name property to be provided during instantiation that, if provided, overrides release-name specified in profile. Additionally updated Makefile to allow easy compilation with different go version easily. Issue-ID: MULTICLOUD-1175 Signed-off-by: Konrad Bańka Change-Id: Id8db484369045cfb0bc99543a80317644fc838f9 --- src/k8splugin/api/brokerhandler.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/k8splugin/api') diff --git a/src/k8splugin/api/brokerhandler.go b/src/k8splugin/api/brokerhandler.go index c98e1c48..05f94b7d 100644 --- a/src/k8splugin/api/brokerhandler.go +++ b/src/k8splugin/api/brokerhandler.go @@ -153,12 +153,20 @@ func (b brokerInstanceHandler) createHandler(w http.ResponseWriter, r *http.Requ return } + releaseName, ok := directives["k8s-rb-instance-release-name"] + if !ok { + //Release name is not mandatory argument, but we're not using profile's default + //as it could conflict if someone wanted to instantiate single profile multiple times + releaseName = req.VFModuleID + } + // Setup the resource parameters for making the request var instReq app.InstanceRequest instReq.RBName = req.VFModuleModelInvariantID instReq.RBVersion = req.VFModuleModelVersionID instReq.ProfileName = profileName instReq.CloudRegion = cloudRegion + instReq.ReleaseName = releaseName instReq.Labels = map[string]string{ "stack-name": req.TemplateData.StackName, } -- cgit 1.2.3-korg