diff options
author | Konrad Bańka <k.banka@samsung.com> | 2020-09-04 14:44:45 +0200 |
---|---|---|
committer | Konrad Banka <k.banka@samsung.com> | 2020-09-08 11:29:55 +0000 |
commit | cf79276e2b633211d9a0befcb0e978dea447a9cf (patch) | |
tree | e7e9c22c6e1e13bb7a039aa3eff23eff246875a1 /src/k8splugin/api/brokerhandler.go | |
parent | d14246bb9a2c8874f9925c45322d678a93584adb (diff) |
Provide capability to specify release-name during instantiation
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 <k.banka@samsung.com>
Change-Id: Id8db484369045cfb0bc99543a80317644fc838f9
Diffstat (limited to 'src/k8splugin/api/brokerhandler.go')
-rw-r--r-- | src/k8splugin/api/brokerhandler.go | 8 |
1 files changed, 8 insertions, 0 deletions
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, } |