Skip to content

Commit 39b63b9

Browse files
committed
remove warning
1 parent c02b921 commit 39b63b9

6 files changed

+0
-26
lines changed

ovh/resource_cloud_project_database.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,8 @@ func resourceCloudProjectDatabaseRead(ctx context.Context, d *schema.ResourceDat
314314
}
315315

316316
diags := make(diag.Diagnostics, 0)
317-
warnAttr := []string{"disk_size", "advanced_configuration"}
318317
for k, v := range res.ToMap() {
319318
if k != "id" {
320-
warningFactory(warnAttr, d, k, v, &diags)
321319
d.Set(k, v)
322320
} else {
323321
d.SetId(fmt.Sprint(v))

ovh/resource_cloud_project_database_integration.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,8 @@ func resourceCloudProjectDatabaseIntegrationRead(ctx context.Context, d *schema.
171171
}
172172

173173
diags := make(diag.Diagnostics, 0)
174-
warnAttr := []string{"type"}
175174
for k, v := range res.ToMap() {
176175
if k != "id" {
177-
warningFactory(warnAttr, d, k, v, &diags)
178176
d.Set(k, v)
179177
} else {
180178
d.SetId(fmt.Sprint(v))

ovh/resource_cloud_project_database_kafka_topic.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,8 @@ func resourceCloudProjectDatabaseKafkaTopicRead(ctx context.Context, d *schema.R
160160
}
161161

162162
diags := make(diag.Diagnostics, 0)
163-
warnAttr := []string{"min_insync_replicas", "partitions", "replication", "retention_bytes", "retention_hours"}
164163
for k, v := range res.ToMap() {
165164
if k != "id" {
166-
warningFactory(warnAttr, d, k, v, &diags)
167165
d.Set(k, v)
168166
} else {
169167
d.SetId(fmt.Sprint(v))

ovh/resource_cloud_project_database_m3db_namespace.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,8 @@ func resourceCloudProjectDatabaseM3dbNamespaceRead(ctx context.Context, d *schem
185185
}
186186

187187
diags := make(diag.Diagnostics, 0)
188-
warnAttr := []string{"retention_block_size_duration"}
189188
for k, v := range res.ToMap() {
190189
if k != "id" {
191-
warningFactory(warnAttr, d, k, v, &diags)
192190
d.Set(k, v)
193191
} else {
194192
d.SetId(fmt.Sprint(v))

ovh/resource_cloud_project_database_redis_user.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,8 @@ func resourceCloudProjectDatabaseRedisUserRead(ctx context.Context, d *schema.Re
133133
}
134134

135135
diags := make(diag.Diagnostics, 0)
136-
warnAttr := []string{"channels"}
137136
for k, v := range res.ToMap() {
138137
if k != "id" {
139-
warningFactory(warnAttr, d, k, v, &diags)
140138
d.Set(k, v)
141139
} else {
142140
d.SetId(fmt.Sprint(v))

ovh/types_cloud_project_database.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"strings"
1010
"time"
1111

12-
"github.com/hashicorp/go-cty/cty"
1312
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1413
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1514
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
@@ -1682,21 +1681,6 @@ func (opts *CloudProjectDatabaseKafkaTopicCreateOpts) FromResource(d *schema.Res
16821681
return opts
16831682
}
16841683

1685-
func warningFactory(warningsAttr []string, d *schema.ResourceData, k string, v interface{}, diags *diag.Diagnostics) {
1686-
if slices.Contains(warningsAttr, k) {
1687-
if _, ok := d.GetOk(k); !ok {
1688-
*diags = append(*diags, diag.Diagnostic{
1689-
Severity: diag.Warning,
1690-
Summary: fmt.Sprintf("Attribute `%s` is not specified", k),
1691-
Detail: fmt.Sprintf("Attribute `%s` is set to it default value : %v", k, v),
1692-
AttributePath: cty.Path{
1693-
cty.GetAttrStep{Name: k},
1694-
},
1695-
})
1696-
}
1697-
}
1698-
}
1699-
17001684
func validateIsSupEqual(v, min int) (errors []error) {
17011685
if v < min {
17021686
errors = append(errors, fmt.Errorf("Value %d is inferior of min value %d", v, min))

0 commit comments

Comments
 (0)