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

Commit

Permalink
Fix tenant type in tenant-fetcher job (#1935)
Browse files Browse the repository at this point in the history
* Fix tenant type in tenant-fetcher job

* Bump PR version

* Fix tests
  • Loading branch information
DimitarPetrov committed Jul 5, 2021
1 parent b7d0fd3 commit df529fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/compass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ global:
version: "PR-1910"
director:
dir:
version: "PR-1927"
version: "PR-1935"
gateway:
dir:
version: "PR-1910"
Expand Down
2 changes: 2 additions & 0 deletions components/director/internal/tenantfetcher/event_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tenantfetcher
import (
"github.com/kyma-incubator/compass/components/director/internal/model"
"github.com/kyma-incubator/compass/components/director/pkg/log"
"github.com/kyma-incubator/compass/components/director/pkg/tenant"
"github.com/pkg/errors"
"github.com/tidwall/gjson"
)
Expand Down Expand Up @@ -115,5 +116,6 @@ func (ep eventsPage) eventDataToTenant(eventType EventsType, eventData []byte) (
Name: name,
ExternalTenant: id,
Provider: ep.providerName,
Type: string(tenant.Account),
}, nil
}
3 changes: 3 additions & 0 deletions components/director/internal/tenantfetcher/event_page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"testing"
"text/template"

"github.com/kyma-incubator/compass/components/director/pkg/tenant"

"github.com/kyma-incubator/compass/components/director/internal/model"
"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -151,6 +153,7 @@ func Test_getTenantMappings(t *testing.T) {
expectedTenantMapping := model.BusinessTenantMappingInput{
ExternalTenant: id,
Name: name,
Type: string(tenant.Account),
Provider: providerName,
}

Expand Down
3 changes: 3 additions & 0 deletions components/director/internal/tenantfetcher/fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package tenantfetcher_test
import (
"fmt"

"github.com/kyma-incubator/compass/components/director/pkg/tenant"

"github.com/google/uuid"

"github.com/kyma-incubator/compass/components/director/internal/model"
Expand Down Expand Up @@ -51,6 +53,7 @@ func fixBusinessTenantMappingInput(name, externalTenant, provider string) model.
return model.BusinessTenantMappingInput{
Name: name,
ExternalTenant: externalTenant,
Type: string(tenant.Account),
Provider: provider,
}
}
Expand Down
3 changes: 3 additions & 0 deletions components/director/internal/tenantfetcher/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"testing"
"time"

"github.com/kyma-incubator/compass/components/director/pkg/tenant"

"github.com/kyma-incubator/compass/components/director/internal/labelfilter"
"github.com/kyma-incubator/compass/components/director/pkg/apperrors"
"github.com/kyma-incubator/compass/components/director/pkg/resource"
Expand Down Expand Up @@ -308,6 +310,7 @@ func TestService_SyncTenants(t *testing.T) {
receivedTenants := []model.BusinessTenantMappingInput{{
Name: "updated-name",
ExternalTenant: busTenant1.ExternalTenant,
Type: string(tenant.Account),
Provider: busTenant1.Provider,
}}

Expand Down

0 comments on commit df529fa

Please sign in to comment.