From 938a1f46ca9d9f5cd5016add0844eb74594d8e5d Mon Sep 17 00:00:00 2001 From: Michal Budzyn Date: Tue, 14 May 2024 21:46:56 +0200 Subject: [PATCH] kafka 3.7 --- .github/workflows/build.yaml | 2 +- .github/workflows/release.yaml | 2 +- Dockerfile | 4 ++-- Dockerfile.all | 4 ++-- Makefile | 2 +- README.md | 6 +++--- proxy/processor_default.go | 2 +- proxy/protocol/request_key_version.go | 14 ++++++++++++++ 8 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3853b9f0..037d5921 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2b410b17..2929fc07 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 diff --git a/Dockerfile b/Dockerfile index 2da559a8..0c939e6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 \ diff --git a/Dockerfile.all b/Dockerfile.all index e0b44767..fe39517c 100644 --- a/Dockerfile.all +++ b/Dockerfile.all @@ -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 @@ -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 \ diff --git a/Makefile b/Makefile index 983539c0..2081bace 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/README.md b/README.md index 5f780754..c81c91c4 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ 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 @@ -47,11 +47,11 @@ As not every Kafka release adds new messages/versions which are relevant to the 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. diff --git a/proxy/processor_default.go b/proxy/processor_default.go index d3a22009..8fe12d9d 100644 --- a/proxy/processor_default.go +++ b/proxy/processor_default.go @@ -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() diff --git a/proxy/protocol/request_key_version.go b/proxy/protocol/request_key_version.go index 89b23425..df4133f7 100644 --- a/proxy/protocol/request_key_version.go +++ b/proxy/protocol/request_key_version.go @@ -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