From 27435db5883432c4b6a2ad04b5d2acb970d6497b Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Wed, 2 Aug 2023 17:51:15 +0100 Subject: [PATCH] fix(proto): cover a few other "identical versions" Co-authored-by: Mark Hindess Signed-off-by: Dominic Evans --- add_offsets_to_txn_request.go | 2 +- add_partitions_to_txn_request.go | 2 +- end_txn_request.go | 2 +- init_producer_id_request.go | 2 +- txn_offset_commit_request.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/add_offsets_to_txn_request.go b/add_offsets_to_txn_request.go index fe6f773bb2..de8a81c64c 100644 --- a/add_offsets_to_txn_request.go +++ b/add_offsets_to_txn_request.go @@ -54,7 +54,7 @@ func (a *AddOffsetsToTxnRequest) headerVersion() int16 { } func (a *AddOffsetsToTxnRequest) isValidVersion() bool { - return a.Version == 0 + return a.Version >= 0 && a.Version <= 2 } func (a *AddOffsetsToTxnRequest) requiredVersion() KafkaVersion { diff --git a/add_partitions_to_txn_request.go b/add_partitions_to_txn_request.go index 61d7b4fde9..b0ba19248c 100644 --- a/add_partitions_to_txn_request.go +++ b/add_partitions_to_txn_request.go @@ -78,7 +78,7 @@ func (a *AddPartitionsToTxnRequest) headerVersion() int16 { } func (a *AddPartitionsToTxnRequest) isValidVersion() bool { - return a.Version == 0 + return a.Version >= 0 && a.Version <= 2 } func (a *AddPartitionsToTxnRequest) requiredVersion() KafkaVersion { diff --git a/end_txn_request.go b/end_txn_request.go index e0e3872c69..c48b958763 100644 --- a/end_txn_request.go +++ b/end_txn_request.go @@ -51,7 +51,7 @@ func (r *EndTxnRequest) headerVersion() int16 { } func (a *EndTxnRequest) isValidVersion() bool { - return a.Version == 0 + return a.Version >= 0 && a.Version <= 2 } func (a *EndTxnRequest) requiredVersion() KafkaVersion { diff --git a/init_producer_id_request.go b/init_producer_id_request.go index ff3f4de787..f94b9c87a9 100644 --- a/init_producer_id_request.go +++ b/init_producer_id_request.go @@ -85,7 +85,7 @@ func (i *InitProducerIDRequest) headerVersion() int16 { } func (i *InitProducerIDRequest) isValidVersion() bool { - return i.Version >= 0 && i.Version <= 3 + return i.Version >= 0 && i.Version <= 4 } func (i *InitProducerIDRequest) requiredVersion() KafkaVersion { diff --git a/txn_offset_commit_request.go b/txn_offset_commit_request.go index 9a1cffca76..4fc4d91376 100644 --- a/txn_offset_commit_request.go +++ b/txn_offset_commit_request.go @@ -97,7 +97,7 @@ func (a *TxnOffsetCommitRequest) headerVersion() int16 { } func (a *TxnOffsetCommitRequest) isValidVersion() bool { - return a.Version == 0 + return a.Version >= 0 && a.Version <= 1 } func (a *TxnOffsetCommitRequest) requiredVersion() KafkaVersion {