From c4f51dff30f64e5cf9c6fc9b3c262b1c126b70e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:45:15 +0000 Subject: [PATCH 1/2] build(deps): bump the main group with 2 updates Bumps the main group with 2 updates: [github.com/aiven/aiven-go-client/v2](https://github.com/aiven/aiven-go-client) and [github.com/aiven/go-client-codegen](https://github.com/aiven/go-client-codegen). Updates `github.com/aiven/aiven-go-client/v2` from 2.27.0 to 2.28.0 - [Release notes](https://github.com/aiven/aiven-go-client/releases) - [Commits](https://github.com/aiven/aiven-go-client/compare/v2.27.0...v2.28.0) Updates `github.com/aiven/go-client-codegen` from 0.39.0 to 0.41.0 - [Release notes](https://github.com/aiven/go-client-codegen/releases) - [Commits](https://github.com/aiven/go-client-codegen/compare/v0.39.0...v0.41.0) --- updated-dependencies: - dependency-name: github.com/aiven/aiven-go-client/v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: main - dependency-name: github.com/aiven/go-client-codegen dependency-type: direct:production update-type: version-update:semver-minor dependency-group: main ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 4f24e6ae6..393d95c76 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/aiven/terraform-provider-aiven go 1.23 require ( - github.com/aiven/aiven-go-client/v2 v2.27.0 - github.com/aiven/go-client-codegen v0.39.0 + github.com/aiven/aiven-go-client/v2 v2.28.0 + github.com/aiven/go-client-codegen v0.41.0 github.com/avast/retry-go v3.0.0+incompatible github.com/dave/jennifer v1.7.1 github.com/docker/go-units v0.5.0 @@ -17,7 +17,6 @@ require ( github.com/hashicorp/terraform-plugin-mux v0.16.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/rs/zerolog v1.33.0 github.com/samber/lo v1.47.0 github.com/stoewer/go-strcase v1.3.0 github.com/stretchr/testify v1.9.0 @@ -42,6 +41,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect diff --git a/go.sum b/go.sum index 96960baa2..7d90d5a8c 100644 --- a/go.sum +++ b/go.sum @@ -195,12 +195,12 @@ github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiA github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/aiven/aiven-go-client/v2 v2.27.0 h1:iTr85xDpD8td3Okj2+djUOfGLlVvngvUwaz/bla3Hzc= -github.com/aiven/aiven-go-client/v2 v2.27.0/go.mod h1:KdHfLIlIRZIfCSEBd39j1Q81jlSb6Nd+oCQKqERfnuA= +github.com/aiven/aiven-go-client/v2 v2.28.0 h1:P2UgIeUCwtDEgeeQkC1sdcWJHat1ViDc03QHS0OrUgQ= +github.com/aiven/aiven-go-client/v2 v2.28.0/go.mod h1:KdHfLIlIRZIfCSEBd39j1Q81jlSb6Nd+oCQKqERfnuA= github.com/aiven/go-api-schemas v1.91.0 h1:jiJpRwFKf3IcuZtMIzDmNyICmX0ayqDYMh9QF0GoFZY= github.com/aiven/go-api-schemas v1.91.0/go.mod h1:qS3E/3R+aKQbHsqXzNHqlXATY1kbVNzhiJvk2IDmADI= -github.com/aiven/go-client-codegen v0.39.0 h1:jyyMd0LJyPUFb1Z7MS39uGbO4GZE2ZpxP1H2xsNbuaE= -github.com/aiven/go-client-codegen v0.39.0/go.mod h1:FfbH32Xb+Hx5zeKTIug1Y8SfMeB+AKNRzxgrzkts2oA= +github.com/aiven/go-client-codegen v0.41.0 h1:lFjl8njSqLmqbXzcHAD0nRBql/U8Ik5x68t+3f0kTnQ= +github.com/aiven/go-client-codegen v0.41.0/go.mod h1:FfbH32Xb+Hx5zeKTIug1Y8SfMeB+AKNRzxgrzkts2oA= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= From c24900a1918ccb444c3b8f3e0d843b0deadc65b6 Mon Sep 17 00:00:00 2001 From: Murad Biashimov Date: Tue, 15 Oct 2024 09:10:23 +0200 Subject: [PATCH 2/2] fix: disk_space int type --- docs/data-sources/account_team_project.md | 2 +- docs/data-sources/project_user.md | 2 +- docs/resources/account_team_project.md | 2 +- docs/resources/organization_group_project.md | 2 +- docs/resources/organization_permission.md | 2 +- docs/resources/project_user.md | 2 +- go.mod | 2 +- internal/schemautil/service.go | 16 +++++++--------- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/data-sources/account_team_project.md b/docs/data-sources/account_team_project.md index 19813446a..c6b53d901 100644 --- a/docs/data-sources/account_team_project.md +++ b/docs/data-sources/account_team_project.md @@ -32,4 +32,4 @@ data "aiven_account_team_project" "account_team_project1" { ### Read-Only - `id` (String) The ID of this resource. -- `team_type` (String) The Account team project type. The possible values are `admin`, `operator`, `developer`, `read_only` and `project:permissions:read`. +- `team_type` (String) The Account team project type. The possible values are `admin`, `operator`, `developer`, `read_only`, `project:permissions:read` and `service:logs:read`. diff --git a/docs/data-sources/project_user.md b/docs/data-sources/project_user.md index 168692096..d617fc274 100644 --- a/docs/data-sources/project_user.md +++ b/docs/data-sources/project_user.md @@ -31,4 +31,4 @@ data "aiven_project_user" "mytestuser" { - `accepted` (Boolean) Whether the user has accepted the request to join the project. Users get an invite and become project members after accepting the invite. - `id` (String) The ID of this resource. -- `member_type` (String) Project membership type. The possible values are `admin`, `developer`, `operator`, `project:permissions:read` and `read_only`. +- `member_type` (String) Project membership type. The possible values are `admin`, `developer`, `operator`, `project:permissions:read`, `read_only` and `service:logs:read`. diff --git a/docs/resources/account_team_project.md b/docs/resources/account_team_project.md index 6ac07a242..82794bd03 100644 --- a/docs/resources/account_team_project.md +++ b/docs/resources/account_team_project.md @@ -48,7 +48,7 @@ resource "aiven_account_team_project" "main" { ### Optional - `project_name` (String) The name of an already existing project -- `team_type` (String) The Account team project type. The possible values are `admin`, `operator`, `developer`, `read_only` and `project:permissions:read`. +- `team_type` (String) The Account team project type. The possible values are `admin`, `operator`, `developer`, `read_only`, `project:permissions:read` and `service:logs:read`. - `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) ### Read-Only diff --git a/docs/resources/organization_group_project.md b/docs/resources/organization_group_project.md index 1d85d0ba8..fb6beb75d 100644 --- a/docs/resources/organization_group_project.md +++ b/docs/resources/organization_group_project.md @@ -44,7 +44,7 @@ resource "aiven_organization_group_project" "example" { - `group_id` (String) The ID of the user group. - `project` (String) The project that the users in the group are members of. -- `role` (String) [Project-level role](https://aiven.io/docs/platform/reference/project-member-privileges) assigned to all users in the group. The possible values are `admin`, `operator`, `developer`, `read_only` and `project:permissions:read`. +- `role` (String) [Project-level role](https://aiven.io/docs/platform/reference/project-member-privileges) assigned to all users in the group. The possible values are `admin`, `operator`, `developer`, `read_only`, `project:permissions:read` and `service:logs:read`. ### Optional diff --git a/docs/resources/organization_permission.md b/docs/resources/organization_permission.md index 9e7138f98..58c19ee0b 100644 --- a/docs/resources/organization_permission.md +++ b/docs/resources/organization_permission.md @@ -70,7 +70,7 @@ resource "aiven_organization_permission" "developers" { Required: -- `permissions` (Set of String) List of permissions. The possible values are `admin`, `developer`, `operator`, `project:permissions:read` and `read_only`. +- `permissions` (Set of String) List of permissions. The possible values are `admin`, `developer`, `operator`, `project:permissions:read`, `read_only` and `service:logs:read`. - `principal_id` (String) ID of the user or group. - `principal_type` (String) The type of principal. The possible values are `user` and `user_group`. diff --git a/docs/resources/project_user.md b/docs/resources/project_user.md index 142e0acd5..a32225e6f 100644 --- a/docs/resources/project_user.md +++ b/docs/resources/project_user.md @@ -26,7 +26,7 @@ resource "aiven_project_user" "mytestuser" { ### Required - `email` (String) Email address of the user in lowercase. Changing this property forces recreation of the resource. -- `member_type` (String) Project membership type. The possible values are `admin`, `developer`, `operator`, `project:permissions:read` and `read_only`. +- `member_type` (String) Project membership type. The possible values are `admin`, `developer`, `operator`, `project:permissions:read`, `read_only` and `service:logs:read`. - `project` (String) The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. ### Optional diff --git a/go.mod b/go.mod index 393d95c76..89ff1f093 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( github.com/hashicorp/terraform-plugin-mux v0.16.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 github.com/kelseyhightower/envconfig v1.4.0 + github.com/rs/zerolog v1.33.0 github.com/samber/lo v1.47.0 github.com/stoewer/go-strcase v1.3.0 github.com/stretchr/testify v1.9.0 @@ -41,7 +42,6 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/rs/zerolog v1.33.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect diff --git a/internal/schemautil/service.go b/internal/schemautil/service.go index 9ba44c676..0d00fa544 100644 --- a/internal/schemautil/service.go +++ b/internal/schemautil/service.go @@ -415,10 +415,9 @@ func resourceServiceCreate(ctx context.Context, d *schema.ResourceData, m interf staticIps := FlattenToString(d.Get("static_ips").(*schema.Set).List()) serviceIntegrations := GetAPIServiceIntegrations(d) - diskSpaceFloat := float64(diskSpace) - var diskSpaceMb *float64 - if diskSpaceFloat > 0 { - diskSpaceMb = &diskSpaceFloat + var diskSpaceMb *int + if diskSpace > 0 { + diskSpaceMb = &diskSpace } serviceCreate := &service.ServiceCreateIn{ @@ -519,10 +518,9 @@ func ResourceServiceUpdate(ctx context.Context, d *schema.ResourceData, m interf powered := true terminationProtection := d.Get("termination_protection").(bool) - diskSpaceFloat := float64(diskSpace) - var diskSpaceMb *float64 - if diskSpaceFloat > 0 { - diskSpaceMb = &diskSpaceFloat + var diskSpaceMb *int + if diskSpace > 0 { + diskSpaceMb = &diskSpace } serviceUpdate := &service.ServiceUpdateIn{ Cloud: &cloud, @@ -677,7 +675,7 @@ func copyServicePropertiesFromAPIResponseToTerraform( diskSpace := 0 if s.DiskSpaceMb != nil { - diskSpace = int(*s.DiskSpaceMb) + diskSpace = *s.DiskSpaceMb } additionalDiskSpace := diskSpace - servicePlanParams.DiskSizeMBDefault