Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Adjust UnsubscribeTenant flow (#2441)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzahariev authored Jun 23, 2022
1 parent c623fd1 commit e1d296e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chart/compass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ global:
version: "PR-2383"
director:
dir:
version: "PR-2430"
version: "PR-2441"
hydrator:
dir:
version: "PR-2385"
Expand Down
7 changes: 5 additions & 2 deletions components/director/internal/domain/subscription/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,21 @@ func (r *Resolver) UnsubscribeTenant(ctx context.Context, providerID string, sub

var success bool

if flowType == resource.ApplicationTemplate {
switch flowType {
case resource.ApplicationTemplate:
log.C(ctx).Infof("Entering Application flow")
success, err = r.subscriptionSvc.UnsubscribeTenantFromApplication(ctx, providerID, providerSubaccountID, region)
if err != nil {
return false, err
}
} else {
case resource.Runtime:
log.C(ctx).Infof("Entering Runtime flow")
success, err = r.subscriptionSvc.UnsubscribeTenantFromRuntime(ctx, providerID, subaccountTenantID, providerSubaccountID, region)
if err != nil {
return false, err
}
default:
log.C(ctx).Infof("Nothing to unsubscribe to provider (%q) in region (%q)", providerID, region)
}

if err = tx.Commit(); err != nil {
Expand Down

0 comments on commit e1d296e

Please sign in to comment.