Skip to content

Commit 926ac82

Browse files
authored
Merge pull request #1151 from ovh/dev/aamstutz/fix-cloud-alerting
fix(cloud_project_alerting): Email not returned by API anymore
2 parents f5c7b7d + 11e8556 commit 926ac82

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

ovh/resource_cloud_project_alerting.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func (r *cloudProjectAlertingResource) Create(ctx context.Context, req resource.
6363

6464
responseData.MergeWith(&data)
6565

66+
// Explicitly set email to the plan value as it's not returned by the API
67+
responseData.Email = data.Email
68+
6669
// Save data into Terraform state
6770
resp.Diagnostics.Append(resp.State.Set(ctx, &responseData)...)
6871
}
@@ -129,6 +132,9 @@ func (r *cloudProjectAlertingResource) Update(ctx context.Context, req resource.
129132

130133
responseData.MergeWith(&planData)
131134

135+
// Explicitly set email to the plan value as it's not returned by the API
136+
responseData.Email = planData.Email
137+
132138
// Save updated data into Terraform state
133139
resp.Diagnostics.Append(resp.State.Set(ctx, &responseData)...)
134140
}

ovh/resource_cloud_project_alerting_gen.go

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ovh/resource_cloud_project_alerting_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestAccCloudProjectAlerting_basic(t *testing.T) {
4848
resource.TestCheckResourceAttr(
4949
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.currency_code", "EUR"),
5050
resource.TestCheckResourceAttr(
51-
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.text", "3000.00 €"),
51+
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.text", "3 000,00 €"),
5252
resource.TestCheckResourceAttr(
5353
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.value", "3000"),
5454
),
@@ -65,7 +65,7 @@ func TestAccCloudProjectAlerting_basic(t *testing.T) {
6565
resource.TestCheckResourceAttr(
6666
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.currency_code", "EUR"),
6767
resource.TestCheckResourceAttr(
68-
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.text", "100.00 €"),
68+
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.text", "100,00 €"),
6969
resource.TestCheckResourceAttr(
7070
"ovh_cloud_project_alerting.alert", "formatted_monthly_threshold.value", "100"),
7171
),

0 commit comments

Comments
 (0)