Skip to content

Commit

Permalink
fix: data storage also needs to be int64. Add appropriate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusramberg committed Oct 14, 2024
1 parent aa05e41 commit 574f896
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/data/principal_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ func TestWifPrincipalSetDataSource(t *testing.T) {
Config: testWifPrincipalSetDataSourceConfig,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("data.wif_principal_set.actions", "id", "wif_principal_set:repo:assertion.arn.contains(\":instance-profile/Production\")"),
resource.TestCheckResourceAttr("data.wif_principal_set.actions", "url", "principalSet://iam.googleapis.com/projects/1976/locations/global/workloadIdentityPools/mypool/repo/assertion.arn.contains(\":instance-profile/Production\")"),
resource.TestCheckResourceAttr("data.wif_principal_set.mygroup", "url", "principalSet://iam.googleapis.com/projects/1976/locations/global/workloadIdentityPools/mypool/attribute.group/mygroup"),
resource.TestCheckResourceAttr("data.wif_principal_set.actions", "url", "principalSet://iam.googleapis.com/projects/244128534539/locations/global/workloadIdentityPools/mypool/repo/assertion.arn.contains(\":instance-profile/Production\")"),
resource.TestCheckResourceAttr("data.wif_principal_set.mygroup", "url", "principalSet://iam.googleapis.com/projects/244128534539/locations/global/workloadIdentityPools/mypool/attribute.group/mygroup"),
),
},
},
Expand All @@ -26,7 +26,7 @@ func TestWifPrincipalSetDataSource(t *testing.T) {

const testWifPrincipalSetDataSourceConfig = `
provider "wif" {
project_id = 1976
project_id = 244128534539
pool_id = "mypool"
}
data "wif_principal_set" "actions" {
Expand Down
4 changes: 2 additions & 2 deletions internal/data/principal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestWifPrincipalDataSource(t *testing.T) {
Config: testWifPrincipalDataSourceConfig,
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("data.wif_principal.actions", "id", "wif_principal:repo:reMarkable/actions"),
resource.TestCheckResourceAttr("data.wif_principal.actions", "url", "principal://iam.googleapis.com/projects/1976/locations/global/workloadIdentityPools/pool/subject/repo:reMarkable/actions"),
resource.TestCheckResourceAttr("data.wif_principal.actions", "url", "principal://iam.googleapis.com/projects/244128534539/locations/global/workloadIdentityPools/pool/subject/repo:reMarkable/actions"),
),
},
},
Expand All @@ -25,7 +25,7 @@ func TestWifPrincipalDataSource(t *testing.T) {

const testWifPrincipalDataSourceConfig = `
provider "wif" {
project_id = 1976
project_id = 244128534539
pool_id = "pool"
}
data "wif_principal" "actions" {
Expand Down
2 changes: 1 addition & 1 deletion internal/data/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type WifDataProvider struct {
}
type WifDataProviderModel struct {
PoolId types.String `tfsdk:"pool_id"`
ProjectId types.Int32 `tfsdk:"project_id"`
ProjectId types.Int64 `tfsdk:"project_id"`
}

func (p *WifDataProvider) Metadata(ctx context.Context, req provider.MetadataRequest, resp *provider.MetadataResponse) {
Expand Down

0 comments on commit 574f896

Please sign in to comment.