Skip to content

Commit

Permalink
lint: various linter changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gene-redpanda committed Sep 11, 2024
1 parent be7a71b commit a5eab94
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion redpanda/cloud/ratelimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion redpanda/models/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions redpanda/resources/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion redpanda/resources/cluster/data_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions redpanda/resources/cluster/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions redpanda/resources/cluster/resource_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit a5eab94

Please sign in to comment.