Skip to content

Commit

Permalink
Support alt. namespace resource uuid as tenant id on undeploy (#1080)
Browse files Browse the repository at this point in the history
* Support alt. namespace resource uuid as tenant id to API gatway
  service during undeploy
  • Loading branch information
pwplusnick authored and mrutkows committed Nov 20, 2019
1 parent 1993f4b commit 5f5e0dd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions deployers/servicedeployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5f5e0dd

Please sign in to comment.