Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support alt. namespace resource uuid as tenant id on undeploy #1080

Merged
merged 1 commit into from
Nov 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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