diff --git a/admin.go b/admin.go index a936fa5b34..d226b76233 100644 --- a/admin.go +++ b/admin.go @@ -716,6 +716,9 @@ func (ca *clusterAdmin) AlterConfig(resourceType ConfigResourceType, name string Resources: resources, ValidateOnly: validateOnly, } + if ca.conf.Version.IsAtLeast(V2_0_0_0) { + request.Version = 1 + } var ( b *Broker diff --git a/alter_configs_request.go b/alter_configs_request.go index cf51beb67d..ee1ab64458 100644 --- a/alter_configs_request.go +++ b/alter_configs_request.go @@ -123,9 +123,16 @@ func (a *AlterConfigsRequest) headerVersion() int16 { } func (a *AlterConfigsRequest) isValidVersion() bool { - return a.Version == 0 + return a.Version >= 0 && a.Version <= 1 } func (a *AlterConfigsRequest) requiredVersion() KafkaVersion { - return V0_11_0_0 + switch a.Version { + case 1: + return V2_0_0_0 + case 0: + return V0_11_0_0 + default: + return V2_0_0_0 + } } diff --git a/alter_configs_response.go b/alter_configs_response.go index 99888840e8..658f32e9a7 100644 --- a/alter_configs_response.go +++ b/alter_configs_response.go @@ -113,11 +113,18 @@ func (a *AlterConfigsResponse) headerVersion() int16 { } func (a *AlterConfigsResponse) isValidVersion() bool { - return a.Version == 0 + return a.Version >= 0 && a.Version <= 1 } func (a *AlterConfigsResponse) requiredVersion() KafkaVersion { - return V0_11_0_0 + switch a.Version { + case 1: + return V2_0_0_0 + case 0: + return V0_11_0_0 + default: + return V2_0_0_0 + } } func (r *AlterConfigsResponse) throttleTime() time.Duration {