Skip to content

Commit

Permalink
feat(proto): extend isValidVersion for server-only ranges
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Hindess <[email protected]>
Signed-off-by: Dominic Evans <[email protected]>
  • Loading branch information
dnwe and hindessm authored Aug 1, 2023
1 parent 26d9b01 commit 031df5d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion create_topics_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (r *CreateTopicsRequest) headerVersion() int16 {
}

func (c *CreateTopicsRequest) isValidVersion() bool {
return c.Version >= 0 && c.Version <= 2
return c.Version >= 0 && c.Version <= 3
}

func (c *CreateTopicsRequest) requiredVersion() KafkaVersion {
Expand Down
2 changes: 1 addition & 1 deletion delete_topics_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (d *DeleteTopicsRequest) headerVersion() int16 {
}

func (d *DeleteTopicsRequest) isValidVersion() bool {
return d.Version >= 0 && d.Version <= 1
return d.Version >= 0 && d.Version <= 3
}

func (d *DeleteTopicsRequest) requiredVersion() KafkaVersion {
Expand Down
2 changes: 1 addition & 1 deletion list_groups_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func (r *ListGroupsRequest) headerVersion() int16 {
}

func (r *ListGroupsRequest) isValidVersion() bool {
return r.Version == 0
return r.Version >= 0 && r.Version <= 2
}

func (r *ListGroupsRequest) requiredVersion() KafkaVersion {
Expand Down
2 changes: 1 addition & 1 deletion sasl_handshake_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (r *SaslHandshakeRequest) headerVersion() int16 {
}

func (r *SaslHandshakeRequest) isValidVersion() bool {
return r.Version == 0
return r.Version >= 0 && r.Version <= 1
}

func (r *SaslHandshakeRequest) requiredVersion() KafkaVersion {
Expand Down

0 comments on commit 031df5d

Please sign in to comment.