diff --git a/redpanda/cloud/ratelimiter_test.go b/redpanda/cloud/ratelimiter_test.go index c91a9c85..d96c805b 100644 --- a/redpanda/cloud/ratelimiter_test.go +++ b/redpanda/cloud/ratelimiter_test.go @@ -119,7 +119,7 @@ func TestRateLimiter_Limiter(t *testing.T) { if tt.headerLimit != "" { headerLimit = fmt.Sprintf(tt.headerLimit, remaining) } - mockInvoker := func(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, opts ...grpc.CallOption) error { + mockInvoker := func(_ context.Context, _ string, _, _ any, cc *grpc.ClientConn, opts ...grpc.CallOption) error { if tt.headerLimit != "" { header := metadata.MD{ "ratelimit": []string{headerLimit}, diff --git a/redpanda/models/cluster.go b/redpanda/models/cluster.go index 612788e7..67628b19 100644 --- a/redpanda/models/cluster.go +++ b/redpanda/models/cluster.go @@ -41,7 +41,7 @@ type Cluster struct { KafkaAPI *KafkaAPI `tfsdk:"kafka_api"` HTTPProxy *HTTPProxy `tfsdk:"http_proxy"` SchemaRegistry *SchemaRegistry `tfsdk:"schema_registry"` - ReadReplicaClusterIds types.List `tfsdk:"read_replica_cluster_ids"` + ReadReplicaClusterIDs types.List `tfsdk:"read_replica_cluster_ids"` } // AwsPrivateLink represents the Terraform schema for the AWS Private Link configuration. diff --git a/redpanda/resources/cluster/cluster.go b/redpanda/resources/cluster/cluster.go index 3de20ada..41bc1e6b 100644 --- a/redpanda/resources/cluster/cluster.go +++ b/redpanda/resources/cluster/cluster.go @@ -207,8 +207,8 @@ func generateClusterRequest(model models.Cluster) (*controlplanev1beta2.ClusterC Mtls: toMtlsSpec(model.SchemaRegistry.Mtls), } } - if !model.ReadReplicaClusterIds.IsNull() { - output.ReadReplicaClusterIds = utils.TypeListToStringSlice(model.ReadReplicaClusterIds) + if !model.ReadReplicaClusterIDs.IsNull() { + output.ReadReplicaClusterIds = utils.TypeListToStringSlice(model.ReadReplicaClusterIDs) } return output, nil @@ -249,7 +249,7 @@ func generateModel(ctx context.Context, cfg models.Cluster, cluster *controlplan if d.HasError() { return nil, fmt.Errorf("failed to parse read replica cluster IDs: %v", d) } - output.ReadReplicaClusterIds = rr + output.ReadReplicaClusterIDs = rr if !isAwsPrivateLinkSpecNil(cluster.AwsPrivateLink) { ap, dg := types.ListValueFrom(ctx, types.StringType, cluster.AwsPrivateLink.AllowedPrincipals) diff --git a/redpanda/resources/cluster/data_cluster.go b/redpanda/resources/cluster/data_cluster.go index 93c4196d..cf3039e2 100644 --- a/redpanda/resources/cluster/data_cluster.go +++ b/redpanda/resources/cluster/data_cluster.go @@ -117,7 +117,7 @@ func (d *DataSourceCluster) Read(ctx context.Context, req datasource.ReadRequest NetworkID: types.StringValue(cluster.NetworkId), ID: types.StringValue(cluster.Id), ClusterAPIURL: types.StringValue(clusterURL), - ReadReplicaClusterIds: rr, + ReadReplicaClusterIDs: rr, } if !isAwsPrivateLinkSpecNil(cluster.AwsPrivateLink) { diff --git a/redpanda/resources/cluster/resource_cluster.go b/redpanda/resources/cluster/resource_cluster.go index 1891cd82..658aa666 100644 --- a/redpanda/resources/cluster/resource_cluster.go +++ b/redpanda/resources/cluster/resource_cluster.go @@ -444,8 +444,8 @@ func (c *Cluster) Update(ctx context.Context, req resource.UpdateRequest, resp * updateReq.UpdateMask.Paths = append(updateReq.UpdateMask.Paths, "schema_registry") } - if !plan.ReadReplicaClusterIds.IsNull() { - updateReq.Cluster.ReadReplicaClusterIds = utils.TypeListToStringSlice(plan.ReadReplicaClusterIds) + if !plan.ReadReplicaClusterIDs.IsNull() { + updateReq.Cluster.ReadReplicaClusterIds = utils.TypeListToStringSlice(plan.ReadReplicaClusterIDs) updateReq.UpdateMask.Paths = append(updateReq.UpdateMask.Paths, "read_replica_cluster_ids") } op, err := c.CpCl.Cluster.UpdateCluster(ctx, updateReq) diff --git a/redpanda/resources/cluster/resource_cluster_test.go b/redpanda/resources/cluster/resource_cluster_test.go index 5efc6c5a..76b58164 100644 --- a/redpanda/resources/cluster/resource_cluster_test.go +++ b/redpanda/resources/cluster/resource_cluster_test.go @@ -141,7 +141,7 @@ func TestGenerateModel(t *testing.T) { NetworkID: types.StringValue("net-456"), ID: types.StringValue("cl-789"), ClusterAPIURL: types.StringValue("test-cluster.rptest.io:443"), - ReadReplicaClusterIds: basetypes.NewListNull(types.StringType), + ReadReplicaClusterIDs: basetypes.NewListNull(types.StringType), Zones: utils.TestingOnlyStringSliceToTypeList([]string{"us-west-2a", "us-west-2b"}), AllowDeletion: types.BoolValue(false), }, @@ -190,7 +190,7 @@ func TestGenerateModel(t *testing.T) { ClusterAPIURL: types.StringValue("gcp-private-cluster.rptest.io:443"), Zones: utils.TestingOnlyStringSliceToTypeList([]string{"us-central1-a", "us-central1-b", "us-central1-c"}), AllowDeletion: types.BoolValue(true), - ReadReplicaClusterIds: basetypes.NewListNull(types.StringType), + ReadReplicaClusterIDs: basetypes.NewListNull(types.StringType), }, wantErr: false, }, @@ -235,7 +235,7 @@ func TestGenerateModel(t *testing.T) { ResourceGroupID: types.StringValue("rg-789"), NetworkID: types.StringValue("net-101"), ClusterAPIURL: types.StringValue("aws-mtls-cluster.rptest.io:443"), - ReadReplicaClusterIds: utils.TestingOnlyStringSliceToTypeList([]string{""}), + ReadReplicaClusterIDs: utils.TestingOnlyStringSliceToTypeList([]string{""}), Zones: utils.TestingOnlyStringSliceToTypeList([]string{"eu-west-1a"}), KafkaAPI: &models.KafkaAPI{ Mtls: &models.Mtls{ @@ -288,7 +288,7 @@ func TestGenerateModel(t *testing.T) { NetworkID: types.StringValue("net-303"), ResourceGroupID: types.StringValue("123"), Zones: utils.TestingOnlyStringSliceToTypeList([]string{"eu-west-1a"}), - ReadReplicaClusterIds: utils.TestingOnlyStringSliceToTypeList([]string{""}), + ReadReplicaClusterIDs: utils.TestingOnlyStringSliceToTypeList([]string{""}), Region: types.StringValue("eu-west-1"), AwsPrivateLink: &models.AwsPrivateLink{ Enabled: types.BoolValue(true), @@ -344,7 +344,7 @@ func TestGenerateModel(t *testing.T) { Region: types.StringValue("us-central1"), ResourceGroupID: types.StringValue("rg-404"), NetworkID: types.StringValue("net-404"), - ReadReplicaClusterIds: utils.TestingOnlyStringSliceToTypeList([]string{""}), + ReadReplicaClusterIDs: utils.TestingOnlyStringSliceToTypeList([]string{""}), Zones: utils.TestingOnlyStringSliceToTypeList([]string{"us-central1-a"}), ClusterAPIURL: types.StringValue("aws-gcp-psc-cluster.rptest.io:443"), GcpPrivateServiceConnect: &models.GcpPrivateServiceConnect{