Skip to content

Commit

Permalink
Merge pull request #41 from credativ/release-2.2.19
Browse files Browse the repository at this point in the history
Release v2.2.19
  • Loading branch information
ntap-fge authored Oct 18, 2024
2 parents 5cab200 + c0324f5 commit 0f21197
Show file tree
Hide file tree
Showing 33 changed files with 72 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.6
go-version: 1.23.2

- name: Install package dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.6
go-version: 1.23.2

- name: Install package dependencies
run: |
Expand All @@ -31,7 +31,7 @@ jobs:
run: |
go install github.com/golang/protobuf/protoc-gen-go@v1.3.0
go install github.com/gogo/protobuf/protoc-gen-gogoslick@v1.2.1
go install github.com/fatih/faillint@v1.11.0
go install github.com/fatih/faillint@v1.14.0
- name: Test
run: make BUILD_IN_CONTAINER=false test
Expand All @@ -40,7 +40,7 @@ jobs:
run: |
cd /
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sudo sh -s v1.55.2
| sudo sh -s v1.61.0
- name: Run Linter
run: make lint
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ issues:
exclude:
- Error return value of .*log\.Logger\)\.Log\x60 is not checked
- Error return value of .*.Log.* is not checked
- '"io/ioutil" has been deprecated'
- rand.Seed has been deprecated
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.2.19 (2024-10-18)

* Upgrade Go to 1.23.2
* Upgrade Alpine to 3.20.3

## 2.2.18 (2024-08-09)

* Upgrade Go to 1.22.6
Expand Down
2 changes: 1 addition & 1 deletion cmd/docker-driver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY . /src/vali
WORKDIR /src/vali
RUN make clean && make BUILD_IN_CONTAINER=false cmd/docker-driver/docker-driver

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates tzdata
COPY --from=build /src/vali/cmd/docker-driver/docker-driver /bin/docker-driver
WORKDIR /bin/
Expand Down
2 changes: 1 addition & 1 deletion cmd/fluent-bit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.6 as build
FROM golang:1.23.2 as build
COPY . /src/vali
WORKDIR /src/vali
RUN make clean && make BUILD_IN_CONTAINER=false fluent-bit-plugin
Expand Down
4 changes: 2 additions & 2 deletions cmd/logcli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.22.6 as build
FROM golang:1.23.2 as build

ARG TOUCH_PROTOS
COPY . /src/vali
WORKDIR /src/vali
RUN make clean && (if [ "${TOUCH_PROTOS}" ]; then make touch-protos; fi) && make BUILD_IN_CONTAINER=false logcli

FROM alpine:3.20.2
FROM alpine:3.20.3

RUN apk add --no-cache ca-certificates

Expand Down
4 changes: 2 additions & 2 deletions cmd/migrate/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM golang:1.22.6 as build
FROM golang:1.23.2 as build
COPY . /src/vali
WORKDIR /src/vali
RUN make clean && make BUILD_IN_CONTAINER=false migrate

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/vali/cmd/migrate/migrate /usr/bin/migrate
#ENTRYPOINT [ "/usr/bin/migrate" ]
Expand Down
4 changes: 2 additions & 2 deletions cmd/querytee/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.22.6 as build
FROM golang:1.23.2 as build

ARG TOUCH_PROTOS
COPY . /src/vali
WORKDIR /src/vali
RUN make clean && make BUILD_IN_CONTAINER=false vali-querytee

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/vali/cmd/querytee/vali-querytee /usr/bin/querytee
ENTRYPOINT [ "/usr/bin/querytee" ]
4 changes: 2 additions & 2 deletions cmd/querytee/Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=ghcr.io/credativ/vali-build-image:0.9.1
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t ghcr.io/credativ/valitail -f cmd/valitail/Dockerfile .
FROM golang:1.22.6-alpine as goenv
FROM golang:1.23.2-alpine as goenv
RUN go env GOARCH > /goarch && \
go env GOARM > /goarm

Expand All @@ -12,7 +12,7 @@ COPY . /src/vali
WORKDIR /src/vali
RUN make clean && GOARCH=$(cat /goarch) GOARM=$(cat /goarm) make BUILD_IN_CONTAINER=false vali-querytee

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/vali/cmd/querytee/querytee /usr/bin/querytee
ENTRYPOINT [ "/usr/bin/querytee" ]
4 changes: 2 additions & 2 deletions cmd/vali-canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.22.6 as build
FROM golang:1.23.2 as build
# TOUCH_PROTOS signifies if we should touch the compiled proto files and thus not regenerate them.
# This is helpful when file system timestamps can't be trusted with make
ARG TOUCH_PROTOS
COPY . /src/vali
WORKDIR /src/vali
RUN make clean && (if [ "${TOUCH_PROTOS}" ]; then make touch-protos; fi) && make BUILD_IN_CONTAINER=false vali-canary

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/vali/cmd/vali-canary/vali-canary /usr/bin/vali-canary
ENTRYPOINT [ "/usr/bin/vali-canary" ]
4 changes: 2 additions & 2 deletions cmd/vali-canary/Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=ghcr.io/credativ/vali-build-image:0.12.0
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t ghcr.io/credativ/valitail -f cmd/valitail/Dockerfile .
FROM golang:1.22.6-alpine as goenv
FROM golang:1.23.2-alpine as goenv
RUN go env GOARCH > /goarch && \
go env GOARM > /goarm

Expand All @@ -12,7 +12,7 @@ COPY . /src/vali
WORKDIR /src/vali
RUN make clean && GOARCH=$(cat /goarch) GOARM=$(cat /goarm) make BUILD_IN_CONTAINER=false vali-canary

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/vali/cmd/vali-canary/vali-canary /usr/bin/vali-canary
ENTRYPOINT [ "/usr/bin/vali-canary" ]
4 changes: 2 additions & 2 deletions cmd/vali/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.22.6 as build
FROM golang:1.23.2 as build
# TOUCH_PROTOS signifies if we should touch the compiled proto files and thus not regenerate them.
# This is helpful when file system timestamps can't be trusted with make
ARG TOUCH_PROTOS
COPY . /src/vali
WORKDIR /src/vali
RUN make clean && (if [ "${TOUCH_PROTOS}" ]; then make touch-protos; fi) && make BUILD_IN_CONTAINER=false vali

FROM alpine:3.20.2
FROM alpine:3.20.3

RUN apk add --no-cache ca-certificates libcap

Expand Down
4 changes: 2 additions & 2 deletions cmd/vali/Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=ghcr.io/credativ/vali-build-image:0.12.0
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t ghcr.io/credativ/vali -f cmd/vali/Dockerfile .
FROM golang:1.22.6-alpine as goenv
FROM golang:1.23.2-alpine as goenv
RUN go env GOARCH > /goarch && \
go env GOARM > /goarm

Expand All @@ -12,7 +12,7 @@ COPY . /src/vali
WORKDIR /src/vali
RUN make clean && GOARCH=$(cat /goarch) GOARM=$(cat /goarm) make BUILD_IN_CONTAINER=false vali

FROM alpine:3.20.2
FROM alpine:3.20.3

RUN apk add --no-cache ca-certificates

Expand Down
2 changes: 1 addition & 1 deletion cmd/vali/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY . /src/vali
WORKDIR /src/vali
RUN make clean && make BUILD_IN_CONTAINER=false vali-debug

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates
COPY --from=build /src/vali/cmd/vali/vali-debug /usr/bin/vali-debug
COPY --from=build /go/bin/dlv /usr/bin/dlv
Expand Down
2 changes: 1 addition & 1 deletion cmd/valitail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.6-bookworm as build
FROM golang:1.23.2-bookworm as build
# TOUCH_PROTOS signifies if we should touch the compiled proto files and thus not regenerate them.
# This is helpful when file system timestamps can't be trusted with make
ARG TOUCH_PROTOS
Expand Down
2 changes: 1 addition & 1 deletion cmd/valitail/Dockerfile.arm32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.5 as build
FROM golang:1.23.2 as build
# TOUCH_PROTOS signifies if we should touch the compiled proto files and thus not regenerate them.
# This is helpful when file system timestamps can't be trusted with make
ARG TOUCH_PROTOS
Expand Down
2 changes: 1 addition & 1 deletion cmd/valitail/Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=ghcr.io/credativ/vali-build-image:0.12.0
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t ghcr.io/credativ/valitail -f cmd/valitail/Dockerfile .
FROM golang:1.22.6-alpine as goenv
FROM golang:1.23.2-alpine as goenv
RUN go env GOARCH > /goarch && \
go env GOARM > /goarm

Expand Down
2 changes: 1 addition & 1 deletion cmd/valitail/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /src/vali
RUN make clean && make BUILD_IN_CONTAINER=false valitail-debug


FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates tzdata
COPY --from=build /src/vali/cmd/valitail/valitail-debug /usr/bin/valitail-debug
COPY --from=build /go/bin/dlv /usr/bin/dlv
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (i *instance) getOrCreateStream(pushReqStream logproto.Stream, lock bool, r
"stream", pushReqStream.Labels,
)
}
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return nil, httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}
fp := i.getHashForLabels(labels)

Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (s *stream) Push(

fmt.Fprintf(&buf, "total ignored: %d out of %d", len(failedEntriesWithError), len(entries))

return bytesAdded, httpgrpc.Errorf(http.StatusBadRequest, buf.String())
return bytesAdded, httpgrpc.Errorf(http.StatusBadRequest, "%s", buf.String())
}
return bytesAdded, lastEntryWithErr.e
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestMaxReturnedStreamsErrors(t *testing.T) {
}

fmt.Fprintf(&expected, "total ignored: %d out of %d", numLogs, numLogs)
expectErr := httpgrpc.Errorf(http.StatusBadRequest, expected.String())
expectErr := httpgrpc.Errorf(http.StatusBadRequest, "%s", expected.String())

_, err = s.Push(context.Background(), newLines, recordPool.GetRecord())
require.Error(t, err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/logentry/stages/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func validateMatcherConfig(cfg *MatcherConfig) (logql.LogSelectorExpr, error) {
return nil, errors.New(ErrUnknownMatchAction)
}

if cfg.Action == MatchActionKeep && (cfg.Stages == nil || len(cfg.Stages) == 0) {
if cfg.Action == MatchActionKeep && len(cfg.Stages) == 0 {
return nil, errors.New(ErrMatchRequiresStages)
}
if cfg.Action == MatchActionDrop && (cfg.Stages != nil && len(cfg.Stages) != 0) {
if cfg.Action == MatchActionDrop && len(cfg.Stages) != 0 {
return nil, errors.New(ErrStagesWithDropLine)
}

Expand Down
1 change: 1 addition & 0 deletions pkg/logql/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func (q *query) evalSample(ctx context.Context, expr SampleExpr) (promql_parser.
return result, stepEvaluator.Error()
}

// nolint: unparam
func (q *query) evalLiteral(_ context.Context, expr *literalExpr) (promql_parser.Value, error) {
s := promql.Scalar{
T: q.params.Start().UnixNano() / int64(time.Millisecond),
Expand Down
4 changes: 2 additions & 2 deletions pkg/logql/log/jsonexpr/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewScanner(r io.Reader, debug bool) *Scanner {
}

func (sc *Scanner) Error(s string) {
sc.err = fmt.Errorf(s)
sc.err = fmt.Errorf("%s", s)
fmt.Printf("syntax error: %s\n", s)
}

Expand Down Expand Up @@ -53,7 +53,7 @@ func (sc *Scanner) lex(lval *JSONExprSymType) int {
sc.unread()
val, err := sc.scanInt()
if err != nil {
sc.err = fmt.Errorf(err.Error())
sc.err = fmt.Errorf("%s", err.Error())
return 0
}

Expand Down
18 changes: 9 additions & 9 deletions pkg/querier/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (q *Querier) RangeQueryHandler(w http.ResponseWriter, r *http.Request) {

request, err := loghttp.ParseRangeQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}

Expand Down Expand Up @@ -78,7 +78,7 @@ func (q *Querier) InstantQueryHandler(w http.ResponseWriter, r *http.Request) {

request, err := loghttp.ParseInstantQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}

Expand Down Expand Up @@ -118,12 +118,12 @@ func (q *Querier) LogQueryHandler(w http.ResponseWriter, r *http.Request) {

request, err := loghttp.ParseRangeQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}
request.Query, err = parseRegexQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}

Expand Down Expand Up @@ -172,7 +172,7 @@ func (q *Querier) LogQueryHandler(w http.ResponseWriter, r *http.Request) {
func (q *Querier) LabelHandler(w http.ResponseWriter, r *http.Request) {
req, err := loghttp.ParseLabelQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}

Expand Down Expand Up @@ -202,13 +202,13 @@ func (q *Querier) TailHandler(w http.ResponseWriter, r *http.Request) {

req, err := loghttp.ParseTailQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}

req.Query, err = parseRegexQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}

Expand Down Expand Up @@ -309,7 +309,7 @@ func (q *Querier) TailHandler(w http.ResponseWriter, r *http.Request) {
func (q *Querier) SeriesHandler(w http.ResponseWriter, r *http.Request) {
req, err := loghttp.ParseSeriesQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error()), w)
return
}

Expand Down Expand Up @@ -348,7 +348,7 @@ func parseRegexQuery(httpRequest *http.Request) (string, error) {
func (q *Querier) validateEntriesLimits(ctx context.Context, query string, limit uint32) error {
userID, err := user.ExtractOrgID(ctx)
if err != nil {
return httpgrpc.Errorf(http.StatusBadRequest, err.Error())
return httpgrpc.Errorf(http.StatusBadRequest, "%s", err.Error())
}

expr, err := logql.ParseExpr(query)
Expand Down
Loading

0 comments on commit 0f21197

Please sign in to comment.