This is an automated email from the ASF dual-hosted git repository. mrutkowski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openwhisk-wskdeploy.git
View the commit online: https://github.com/apache/openwhisk-wskdeploy/commit/5f5e0dda1f21400cc868f8bd2f17a150f3cc29c4 The following commit(s) were added to refs/heads/master by this push: new 5f5e0dd Support alt. namespace resource uuid as tenant id on undeploy (#1080) 5f5e0dd is described below commit 5f5e0dda1f21400cc868f8bd2f17a150f3cc29c4 Author: Will Plusnick <pwplusn...@users.noreply.github.com> AuthorDate: Wed Nov 20 09:28:10 2019 -0600 Support alt. namespace resource uuid as tenant id on undeploy (#1080) * Support alt. namespace resource uuid as tenant id to API gatway service during undeploy --- deployers/servicedeployer.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go index 450090f..770ee6c 100644 --- a/deployers/servicedeployer.go +++ b/deployers/servicedeployer.go @@ -1351,7 +1351,13 @@ func (deployer *ServiceDeployer) isApi(api *whisk.ApiCreateRequest) bool { apiReqOptions := new(whisk.ApiGetRequestOptions) apiReqOptions.AccessToken = deployer.Client.Config.ApigwAccessToken apiReqOptions.ApiBasePath = api.ApiDoc.GatewayBasePath - apiReqOptions.SpaceGuid = strings.Split(deployer.Client.Config.AuthToken, ":")[0] + if len(deployer.Client.Config.ApigwTenantId) > 0 { + // Use it to identify the IAM namespace + apiReqOptions.SpaceGuid = deployer.Client.Config.ApigwTenantId + } else { + // assume a CF namespaces (SpaceGuid) which is part of the authtoken + apiReqOptions.SpaceGuid = strings.Split(deployer.Client.Config.AuthToken, ":")[0] + } a := new(whisk.ApiGetRequest) @@ -1379,7 +1385,13 @@ func (deployer *ServiceDeployer) deleteApi(api *whisk.ApiCreateRequest) error { apiDeleteReqOptions := new(whisk.ApiDeleteRequestOptions) apiDeleteReqOptions.AccessToken = deployer.Client.Config.ApigwAccessToken - apiDeleteReqOptions.SpaceGuid = strings.Split(deployer.Client.Config.AuthToken, ":")[0] + if len(deployer.Client.Config.ApigwTenantId) > 0 { + // Use it to identify the IAM namespace + apiDeleteReqOptions.SpaceGuid = deployer.Client.Config.ApigwTenantId + } else { + // assume a CF namespaces (SpaceGuid) which is part of the authtoken + apiDeleteReqOptions.SpaceGuid = strings.Split(deployer.Client.Config.AuthToken, ":")[0] + } apiDeleteReqOptions.ApiBasePath = api.ApiDoc.GatewayBasePath apiDeleteReqOptions.ApiRelPath = api.ApiDoc.GatewayRelPath apiDeleteReqOptions.ApiVerb = api.ApiDoc.GatewayMethod