Skip to content

Commit

Permalink
Merge pull request grepplabs#167 from grepplabs/kafka-3.7
Browse files Browse the repository at this point in the history
kafka 3.7
  • Loading branch information
everesio authored May 14, 2024
2 parents 5676da6 + 938a1f4 commit 1839a88
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
- run: go version
- name: Run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
- run: go version
- name: Run build and test
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine3.17 as builder
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 as builder
RUN apk add alpine-sdk ca-certificates

ARG TARGETOS
Expand All @@ -21,7 +21,7 @@ RUN mkdir -p build && \
go build -mod=vendor -o build/kafka-proxy \
-ldflags "${LDFLAGS}" .

FROM --platform=$BUILDPLATFORM alpine:3.17
FROM --platform=$BUILDPLATFORM alpine:3.19
RUN apk add --no-cache ca-certificates libcap
RUN adduser \
--disabled-password \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.all
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine3.17 as builder
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 as builder
RUN apk add alpine-sdk ca-certificates

ARG TARGETOS
Expand Down Expand Up @@ -27,7 +27,7 @@ RUN mkdir -p build && \
go build -mod=vendor -o build/unsecured-jwt-provider -ldflags "${LDFLAGS}" cmd/plugin-unsecured-jwt-provider/main.go && \
go build -mod=vendor -o build/oidc-provider -ldflags "${LDFLAGS}" cmd/plugin-oidc-provider/main.go

FROM --platform=$BUILDPLATFORM alpine:3.17
FROM --platform=$BUILDPLATFORM alpine:3.19
RUN apk add --no-cache ca-certificates libcap
RUN adduser \
--disabled-password \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ VERSION ?= $(shell git describe --tags --always --dirty)
GOPKGS = $(shell go list ./... | grep -v /vendor/)
BUILD_FLAGS ?=
LDFLAGS ?= -X github.com/grepplabs/kafka-proxy/config.Version=$(VERSION) -w -s
TAG ?= "v0.3.8"
TAG ?= "v0.3.9"
GOOS ?= $(if $(TARGETOS),$(TARGETOS),linux)
GOARCH ?= $(if $(TARGETARCH),$(TARGETARCH),amd64)
GOARM ?= $(TARGETVARIANT)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ As not every Kafka release adds new messages/versions which are relevant to the
| | from 0.11.0 |
| 0.2.9 | to 2.8.0 |
| 0.3.1 | to 3.4.0 |

| 0.3.9 | to 3.7.0 |

### Install binary release

1. Download the latest release

Linux

curl -Ls https://github.com/grepplabs/kafka-proxy/releases/download/v0.3.8/kafka-proxy-v0.3.8-linux-amd64.tar.gz | tar xz
curl -Ls https://github.com/grepplabs/kafka-proxy/releases/download/v0.3.9/kafka-proxy-v0.3.9-linux-amd64.tar.gz | tar xz

macOS

curl -Ls https://github.com/grepplabs/kafka-proxy/releases/download/v0.3.8/kafka-proxy-v0.3.8-darwin-amd64.tar.gz | tar xz
curl -Ls https://github.com/grepplabs/kafka-proxy/releases/download/v0.3.9/kafka-proxy-v0.3.9-darwin-amd64.tar.gz | tar xz

2. Move the binary in to your PATH.

Expand Down
2 changes: 1 addition & 1 deletion proxy/processor_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (handler *DefaultRequestHandler) handleRequest(dst DeadlineWriter, src Dead
logrus.Debugf("Kafka request key %v, version %v, length %v", requestKeyVersion.ApiKey, requestKeyVersion.ApiVersion, requestKeyVersion.Length)

if requestKeyVersion.ApiKey < minRequestApiKey || requestKeyVersion.ApiKey > maxRequestApiKey {
return true, fmt.Errorf("api key %d is invalid", requestKeyVersion.ApiKey)
return true, fmt.Errorf("api key %d is invalid, possible cause: using plain connection instead of TLS", requestKeyVersion.ApiKey)
}

proxyRequestsTotal.WithLabelValues(ctx.brokerAddress, strconv.Itoa(int(requestKeyVersion.ApiKey)), strconv.Itoa(int(requestKeyVersion.ApiVersion))).Inc()
Expand Down
14 changes: 14 additions & 0 deletions proxy/protocol/request_key_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,20 @@ func (r *RequestKeyVersion) ResponseHeaderVersion() int16 {
return 1
case 67: // AllocateProducerIds
return 1
case 68: // ConsumerGroupHeartbeat
return 1
case 69: // ConsumerGroupDescribe
return 1
case 70: // ControllerRegistration
return 1
case 71: // GetTelemetrySubscriptions
return 1
case 72: // PushTelemetry
return 1
case 73: // AssignReplicasToDirs
return 1
case 74: // ListClientMetricsResources
return 1
default:
// throw new UnsupportedVersionException("Unsupported API key " + apiKey);
return -1
Expand Down

0 comments on commit 1839a88

Please sign in to comment.