Skip to content

Commit

Permalink
fix(kafkatopic): temporarily disable local_retention_* fields (#1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serpentiel authored Jan 5, 2024
1 parent 8047a3d commit 5a437dc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ nav_order: 1

## [MAJOR.MINOR.PATCH] - YYYY-MM-DD

## [4.12.1] - 2024-01-05

- Temporarily disable `local_retention_*` fields in `aiven_kafka_topic` resource

## [4.12.0] - 2024-01-03

- Fix insufficient brokers error when create kafka topic
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/kafka_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Optional:
- `flush_messages` (String) flush.messages value
- `flush_ms` (String) flush.ms value
- `index_interval_bytes` (String) index.interval.bytes value
- `local_retention_bytes` (String) local.retention.bytes value
- `local_retention_ms` (String) local.retention.ms value
- `local_retention_bytes` (String) local.retention.bytes value. This field is temporarily disabled.
- `local_retention_ms` (String) local.retention.ms value. This field is temporarily disabled.
- `max_compaction_lag_ms` (String) max.compaction.lag.ms value
- `max_message_bytes` (String) max.message.bytes value
- `message_downconversion_enable` (Boolean) message.downconversion.enable value
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/aiven/terraform-provider-aiven
go 1.21

require (
github.com/aiven/aiven-go-client/v2 v2.7.0
github.com/aiven/aiven-go-client/v2 v2.8.0
github.com/avast/retry-go v3.0.0+incompatible
github.com/dave/jennifer v1.7.0
github.com/docker/go-units v0.5.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ github.com/aiven/aiven-go-client/v2 v2.6.1-0.20240102144320-a7653ed76349 h1:8yrp
github.com/aiven/aiven-go-client/v2 v2.6.1-0.20240102144320-a7653ed76349/go.mod h1:x0xhzxWEKAwKv0xY5FvECiI6tesWshcPHvjwl0B/1SU=
github.com/aiven/aiven-go-client/v2 v2.7.0 h1:nvDfzxsELIt+df7zLqePbrI6ZtazmNvhy/8LyKOZ810=
github.com/aiven/aiven-go-client/v2 v2.7.0/go.mod h1:x0xhzxWEKAwKv0xY5FvECiI6tesWshcPHvjwl0B/1SU=
github.com/aiven/aiven-go-client/v2 v2.8.0 h1:1JZVmpp2emjrIWrDiec9+7CqTRyH/qTnhzJxkYUgVlU=
github.com/aiven/aiven-go-client/v2 v2.8.0/go.mod h1:x0xhzxWEKAwKv0xY5FvECiI6tesWshcPHvjwl0B/1SU=
github.com/aiven/go-api-schemas v1.51.0 h1:6e9oxSTIhKFixOJV3fbnrpKAULhVxls4U4smZjRE7cU=
github.com/aiven/go-api-schemas v1.51.0/go.mod h1:/bPxBUHza/2Aeer6hIIdB++GxKiw9K1KCBtRa2rtZ5I=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
Expand Down
12 changes: 6 additions & 6 deletions internal/sdkprovider/service/kafkatopic/kafka_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ var aivenKafkaTopicSchema = map[string]*schema.Schema{
},
"local_retention_bytes": {
Type: schema.TypeString,
Description: "local.retention.bytes value",
Description: "local.retention.bytes value. This field is temporarily disabled.",
Optional: true,
DiffSuppressFunc: schemautil.EmptyObjectDiffSuppressFunc,
},
"local_retention_ms": {
Type: schema.TypeString,
Description: "local.retention.ms value",
Description: "local.retention.ms value. This field is temporarily disabled.",
Optional: true,
DiffSuppressFunc: schemautil.EmptyObjectDiffSuppressFunc,
},
Expand Down Expand Up @@ -356,8 +356,8 @@ func getKafkaTopicConfig(d *schema.ResourceData) aiven.KafkaTopicConfig {
SegmentMs: schemautil.ParseOptionalStringToInt64(configRaw["segment_ms"]),
UncleanLeaderElectionEnable: schemautil.OptionalBoolPointer(d, "config.0.unclean_leader_election_enable"),
RemoteStorageEnable: schemautil.OptionalBoolPointer(d, "config.0.remote_storage_enable"),
LocalRetentionBytes: schemautil.ParseOptionalStringToInt64(configRaw["local_retention_bytes"]),
LocalRetentionMs: schemautil.ParseOptionalStringToInt64(configRaw["local_retention_ms"]),
//LocalRetentionBytes: schemautil.ParseOptionalStringToInt64(configRaw["local_retention_bytes"]),
//LocalRetentionMs: schemautil.ParseOptionalStringToInt64(configRaw["local_retention_ms"]),
}
}

Expand Down Expand Up @@ -512,8 +512,8 @@ func flattenKafkaTopicConfig(t *aiven.KafkaTopic) []map[string]interface{} {
"segment_ms": schemautil.ToOptionalString(t.Config.SegmentMs.Value),
"unclean_leader_election_enable": t.Config.UncleanLeaderElectionEnable.Value,
"remote_storage_enable": t.Config.RemoteStorageEnable.Value,
"local_retention_bytes": schemautil.ToOptionalString(t.Config.LocalRetentionBytes.Value),
"local_retention_ms": schemautil.ToOptionalString(t.Config.LocalRetentionMs.Value),
//"local_retention_bytes": schemautil.ToOptionalString(t.Config.LocalRetentionBytes.Value),
//"local_retention_ms": schemautil.ToOptionalString(t.Config.LocalRetentionMs.Value),
},
}
}

0 comments on commit 5a437dc

Please sign in to comment.