From b77ed583bdc0e77711657fa1211f43b0a728e639 Mon Sep 17 00:00:00 2001 From: Myroslav Vivcharyk Date: Wed, 8 Jan 2025 18:24:24 +0100 Subject: [PATCH] feat(kafka_quota): changed request_percentage field to float type --- internal/sdkprovider/service/kafka/kafka_quota.go | 2 +- internal/sdkprovider/service/kafka/kafka_quota_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/sdkprovider/service/kafka/kafka_quota.go b/internal/sdkprovider/service/kafka/kafka_quota.go index a89a12c50..ba305904c 100644 --- a/internal/sdkprovider/service/kafka/kafka_quota.go +++ b/internal/sdkprovider/service/kafka/kafka_quota.go @@ -69,7 +69,7 @@ Exceeding this limit results in client throttling.`, AtLeastOneOf: []string{"consumer_byte_rate", "producer_byte_rate", "request_percentage"}, }, "request_percentage": { - Type: schema.TypeInt, + Type: schema.TypeFloat, Optional: true, Description: ` Sets the maximum percentage of CPU time that a client group can use on request handler I/O and network threads per broker within a quota window. diff --git a/internal/sdkprovider/service/kafka/kafka_quota_test.go b/internal/sdkprovider/service/kafka/kafka_quota_test.go index ca7918a7e..4016beb00 100644 --- a/internal/sdkprovider/service/kafka/kafka_quota_test.go +++ b/internal/sdkprovider/service/kafka/kafka_quota_test.go @@ -282,13 +282,13 @@ resource "aiven_kafka_quota" "{{ .resource_name }}" { "client_id": clientID, "consumer_byte_rate": 4000, "producer_byte_rate": 4000, - "request_percentage": 40, + "request_percentage": 40.5, }). Add("kafka_quota", map[string]any{ "resource_name": "user", "service_name": serviceName, "user": user, - "request_percentage": 20, + "request_percentage": 20.22, }). Add("kafka_quota", map[string]any{ "resource_name": "client", @@ -304,12 +304,12 @@ resource "aiven_kafka_quota" "{{ .resource_name }}" { resource.TestCheckResourceAttr(fmt.Sprintf("%s.new_full", kafkaQuotaResource), "client_id", clientID), resource.TestCheckResourceAttr(fmt.Sprintf("%s.new_full", kafkaQuotaResource), "consumer_byte_rate", "4000"), resource.TestCheckResourceAttr(fmt.Sprintf("%s.new_full", kafkaQuotaResource), "producer_byte_rate", "4000"), - resource.TestCheckResourceAttr(fmt.Sprintf("%s.new_full", kafkaQuotaResource), "request_percentage", "40"), + resource.TestCheckResourceAttr(fmt.Sprintf("%s.new_full", kafkaQuotaResource), "request_percentage", "40.5"), resource.TestCheckResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "project", projectName), resource.TestCheckResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "service_name", serviceName), resource.TestCheckResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "user", user), - resource.TestCheckResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "request_percentage", "20"), + resource.TestCheckResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "request_percentage", "20.22"), resource.TestCheckNoResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "client_id"), resource.TestCheckNoResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "consumer_byte_rate"), resource.TestCheckNoResourceAttr(fmt.Sprintf("%s.user", kafkaQuotaResource), "producer_byte_rate"),