From d57f10a5e97f131529eeec76040b9f7e5374af19 Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Fri, 30 Jun 2023 15:14:16 -0400 Subject: [PATCH] Major updates * Build using Go 1.23 * Update all dependencies including Kubernetes to 1.29.12 * Replace go-kit logging with slog from promslog * Update all Github Actions to latest versions --- .dockerignore | 1 + .github/workflows/release.yaml | 12 +- .github/workflows/release_docker.yaml | 14 +- .github/workflows/test.yaml | 42 +++-- .golangci.errcheck-exclude | 4 - .golangci.yml | 3 +- Dockerfile | 6 +- Makefile | 25 ++- README.md | 2 +- go.mod | 60 +++--- go.sum | 258 ++++++++------------------ main.go | 167 +++++++---------- main_test.go | 34 ++-- 13 files changed, 246 insertions(+), 382 deletions(-) delete mode 100644 .golangci.errcheck-exclude diff --git a/.dockerignore b/.dockerignore index 51b6ba7..8460943 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ install *.md *.tar.gz +dist diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f31bf44..9b42b21 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,17 +13,17 @@ jobs: - name: Set version run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Install Helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4.20 with: - version: v3.8.0 + version: v3.12.2 - uses: creekorful/goreportcard-action@v1.0 - name: Make Release env: @@ -32,10 +32,10 @@ jobs: rm -rf release make release - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v6 with: version: latest - args: release --rm-dist --debug + args: release --clean --verbose env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish Helm charts diff --git a/.github/workflows/release_docker.yaml b/.github/workflows/release_docker.yaml index 26f223c..708d0d2 100644 --- a/.github/workflows/release_docker.yaml +++ b/.github/workflows/release_docker.yaml @@ -22,25 +22,25 @@ jobs: fi echo "REF=${ref}" >> $GITHUB_ENV echo "VERSION=${version}" >> $GITHUB_ENV - - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Login to quay.io - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_ACCESS_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: - context: ./ + context: . file: ./Dockerfile push: true tags: ohiosupercomputer/job-pod-reaper:${{ env.VERSION }},quay.io/ohiosupercomputercenter/job-pod-reaper:${{ env.VERSION }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 291fc1e..ef0e88c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,17 +11,17 @@ jobs: runs-on: ubuntu-latest name: Test steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 3 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: go.mod - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.51.2 + version: v1.63.4 args: --timeout=5m skip-cache: true - name: Run tests @@ -29,7 +29,7 @@ jobs: - name: Run coverage run: make coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.txt @@ -37,28 +37,29 @@ jobs: runs-on: ubuntu-latest name: Build steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Build run: make build - name: Run GoReleaser build - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v6 with: version: latest - args: build --rm-dist --snapshot + args: build --snapshot --clean - name: Docker Build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: + context: . push: false tags: quay.io/ohiosupercomputercenter/job-pod-reaper:latest outputs: type=docker,dest=/tmp/job-pod-reaper.tar - name: Upload Docker image - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: image path: /tmp/job-pod-reaper.tar @@ -68,29 +69,30 @@ jobs: name: Test Helm Chart steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v3 + uses: azure/setup-helm@v4.2.0 with: version: v3.8.0 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.11 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.4.0 + uses: helm/chart-testing-action@v2.6.1 - name: Download image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: image path: /tmp - name: Run chart-testing (lint) run: ct lint --target-branch=main --check-version-increment=false - name: Create kind cluster - uses: helm/kind-action@v1.4.0 + uses: helm/kind-action@v1.12.0 with: - version: v0.18.0 + version: v0.26.0 + node_image: kindest/node:v1.29.12@sha256:62c0672ba99a4afd7396512848d6fc382906b8f33349ae68fb1dbfe549f70dec cluster_name: kind - name: Load image run: | diff --git a/.golangci.errcheck-exclude b/.golangci.errcheck-exclude deleted file mode 100644 index 14b824f..0000000 --- a/.golangci.errcheck-exclude +++ /dev/null @@ -1,4 +0,0 @@ -// Used in HTTP handlers, any error is handled by the server itself. -(net/http.ResponseWriter).Write -// Never check for logger errors. -(github.com/go-kit/log.Logger).Log diff --git a/.golangci.yml b/.golangci.yml index c1d979d..e1b8ad7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,3 +1,4 @@ linters-settings: errcheck: - exclude: .golangci.errcheck-exclude + exclude-functions: + - '(net/http.ResponseWriter).Write' diff --git a/Dockerfile b/Dockerfile index 251df48..f5c99e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM golang:1.19-alpine AS builder +FROM golang:1.23-alpine3.21 AS builder RUN apk update && apk add git make WORKDIR /go/src/app -COPY . ./ +COPY . . ARG VERSION="main" RUN make build VERSION=${VERSION} -FROM alpine:3.12 +FROM alpine:3.21 RUN apk --no-cache add ca-certificates WORKDIR / COPY --from=builder /go/src/app/job-pod-reaper . diff --git a/Makefile b/Makefile index 4e35c7d..d10023a 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,27 @@ export GOPATH ?= $(firstword $(subst :, ,$(shell go env GOPATH))) -GOOS := linux -GOARCH := amd64 +GOHOSTOS ?= $(shell go env GOHOSTOS) +GOHOSTARCH ?= $(shell go env GOHOSTARCH) GOLANGCI_LINT := $(GOPATH)/bin/golangci-lint -GOLANGCI_LINT_VERSION := v1.51.2 +GOLANGCI_LINT_VERSION := v1.63.4 VERSION ?= $(shell git describe --tags --abbrev=0 || git rev-parse --short HEAD) GITSHA := $(shell git rev-parse HEAD) GITBRANCH := $(shell git rev-parse --abbrev-ref HEAD) BUILDUSER := $(shell whoami)@$(shell hostname) BUILDDATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") +ifeq ($(GOHOSTARCH),amd64) + ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux freebsd darwin windows)) + # Only supported on amd64 + test-flags := -race + endif +endif + .PHONY: unused lint style test release all: unused lint style test build: - GO111MODULE=on GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go build -ldflags="\ + GO111MODULE=on GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) CGO_ENABLED=0 go build -ldflags="\ -X github.com/prometheus/common/version.Version=$(VERSION) \ -X github.com/prometheus/common/version.Revision=$(GITSHA) \ -X github.com/prometheus/common/version.Branch=$(GITBRANCH) \ @@ -23,20 +30,20 @@ build: -o job-pod-reaper main.go test: - GO111MODULE=on GOOS=$(GOOS) GOARCH=$(GOARCH) go test -race ./... + GO111MODULE=on GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go test $(test-flags) ./... coverage: - GO111MODULE=on GOOS=$(GOOS) GOARCH=$(GOARCH) go test -race -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./... + GO111MODULE=on GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go test $(test-flags) -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./... unused: @echo ">> running check for unused/missing packages in go.mod" - GO111MODULE=on GOOS=$(GOOS) GOARCH=$(GOARCH) go mod tidy + GO111MODULE=on GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go mod tidy @git diff --exit-code -- go.sum go.mod lint: $(GOLANGCI_LINT) @echo ">> running golangci-lint" - GO111MODULE=on GOOS=$(GOOS) GOARCH=$(GOARCH) go list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null - GO111MODULE=on GOOS=$(GOOS) GOARCH=$(GOARCH) $(GOLANGCI_LINT) run ./... + GO111MODULE=on GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null + GO111MODULE=on GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) $(GOLANGCI_LINT) run ./... style: @echo ">> checking code style" diff --git a/README.md b/README.md index 6595d5b..160b9ed 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Metrics about the count of reaped resources, duration of last reaping, and error ## Kubernetes support -Currently this code is built and tested against Kubernetes 1.25.x and 1.26.x. +Currently this code is built and tested against Kubernetes 1.29.x. ## Install diff --git a/go.mod b/go.mod index 3c11a60..33cd6dd 100644 --- a/go.mod +++ b/go.mod @@ -1,62 +1,60 @@ module github.com/OSC/job-pod-reaper -go 1.20 +go 1.23 require ( - github.com/go-kit/log v0.2.1 - github.com/prometheus/client_golang v1.14.0 - github.com/prometheus/common v0.39.0 - gopkg.in/alecthomas/kingpin.v2 v2.2.6 - k8s.io/api v0.26.1 - k8s.io/apimachinery v0.26.1 - k8s.io/client-go v0.26.1 + github.com/alecthomas/kingpin/v2 v2.4.0 + github.com/prometheus/client_golang v1.20.4 + github.com/prometheus/common v0.61.0 + k8s.io/api v0.29.12 + k8s.io/apimachinery v0.29.12 + k8s.io/client-go v0.29.12 ) require ( - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.10.1 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/gnostic v0.6.9 // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/imdario/mergo v0.3.11 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/oauth2 v0.4.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/xhit/go-str2duration/v2 v2.1.0 // indirect + golang.org/x/net v0.32.0 // indirect + golang.org/x/oauth2 v0.24.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.35.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.90.0 // indirect - k8s.io/kube-openapi v0.0.0-20230131200451-5e46c6e584a1 // indirect - k8s.io/utils v0.0.0-20230115233650-391b47cb4029 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index fc0b747..152ea9a 100644 --- a/go.sum +++ b/go.sum @@ -1,107 +1,66 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= +github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= -github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= -github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/gnostic v0.6.9 h1:ZK/5VhkoX835RikCHpSUJV9a+S3e1zLh59YnyWeBW+0= -github.com/google/gnostic v0.6.9/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -109,176 +68,109 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= -github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= -github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= +github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= +github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= -golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= +golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.26.1 h1:f+SWYiPd/GsiWwVRz+NbFyCgvv75Pk9NK6dlkZgpCRQ= -k8s.io/api v0.26.1/go.mod h1:xd/GBNgR0f707+ATNyPmQ1oyKSgndzXij81FzWGsejg= -k8s.io/apimachinery v0.26.1 h1:8EZ/eGJL+hY/MYCNwhmDzVqq2lPl3N3Bo8rvweJwXUQ= -k8s.io/apimachinery v0.26.1/go.mod h1:tnPmbONNJ7ByJNz9+n9kMjNP8ON+1qoAIIC70lztu74= -k8s.io/client-go v0.26.1 h1:87CXzYJnAMGaa/IDDfRdhTzxk/wzGZ+/HUQpqgVSZXU= -k8s.io/client-go v0.26.1/go.mod h1:IWNSglg+rQ3OcvDkhY6+QLeasV4OYHDjdqeWkDQZwGE= -k8s.io/klog/v2 v2.90.0 h1:VkTxIV/FjRXn1fgNNcKGM8cfmL1Z33ZjXRTVxKCoF5M= -k8s.io/klog/v2 v2.90.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20230131200451-5e46c6e584a1 h1:pwP7dvckPjw2FXSpwYg2m8DsCn+3698XTMZZKIkTdfE= -k8s.io/kube-openapi v0.0.0-20230131200451-5e46c6e584a1/go.mod h1:/BYxry62FuDzmI+i9B+X2pqfySRmSOW2ARmj5Zbqhj0= -k8s.io/utils v0.0.0-20230115233650-391b47cb4029 h1:L8zDtT4jrxj+TaQYD0k8KNlr556WaVQylDXswKmX+dE= -k8s.io/utils v0.0.0-20230115233650-391b47cb4029/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/api v0.29.12 h1:SsEEMtFupOAt3pAAtAz0PDu+54g3L5rwbSCi0xQzAJM= +k8s.io/api v0.29.12/go.mod h1:QFwqOP+7LNoAG1RI3vKAFxjKSLQTCamcPzAQ0Z/Yhuk= +k8s.io/apimachinery v0.29.12 h1:k6OdfK9xaNANQvWkl1pSICJGLjB4jSuJ3gGP9hBKOhE= +k8s.io/apimachinery v0.29.12/go.mod h1:i3FJVwhvSp/6n8Fl4K97PJEP8C+MM+aoDq4+ZJBf70Y= +k8s.io/client-go v0.29.12 h1:PjwJXavmpAqOWBRy4U5V/g3JQBpclIHEn5dvfTfsY+w= +k8s.io/client-go v0.29.12/go.mod h1:hRHG6tAKxaLVKF5SlMqgXrbqPEoUcUpJGFFrC3jU69A= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= +k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= +sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/main.go b/main.go index f5ecf44..3399371 100644 --- a/main.go +++ b/main.go @@ -16,17 +16,18 @@ package main import ( "context" "fmt" + "log/slog" "net/http" "os" "strings" "time" - "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/alecthomas/kingpin/v2" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/prometheus/common/promslog" + "github.com/prometheus/common/promslog/flag" "github.com/prometheus/common/version" - kingpin "gopkg.in/alecthomas/kingpin.v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" @@ -53,12 +54,6 @@ var ( kubeconfig = kingpin.Flag("kubeconfig", "Path to kubeconfig when running outside Kubernetes cluster").Default("").Envar("KUBECONFIG").String() listenAddress = kingpin.Flag("listen-address", "Address to listen for HTTP requests").Default(":8080").Envar("LISTEN_ADDRESS").String() processMetrics = kingpin.Flag("process-metrics", "Collect metrics about running process such as CPU and memory and Go stats").Default("true").Envar("PROCESS_METRICS").Bool() - logLevel = kingpin.Flag("log-level", "Log level, One of: [debug, info, warn, error]").Default("info").Envar("LOG_LEVEL").String() - logFormat = kingpin.Flag("log-format", "Log format, One of: [logfmt, json]").Default("logfmt").Envar("LOG_FORMAT").String() - timestampFormat = log.TimestampFormat( - func() time.Time { return time.Now().UTC() }, - "2006-01-02T15:04:05.000Z07:00", - ) timeNow = time.Now metricBuildInfo = prometheus.NewGauge(prometheus.GaugeOpts{ Namespace: metricsNamespace, @@ -120,54 +115,36 @@ func init() { func main() { kingpin.Version(version.Print(appName)) + promslogConfig := &promslog.Config{} + flag.AddFlags(kingpin.CommandLine, promslogConfig) kingpin.HelpFlag.Short('h') kingpin.Parse() - var logger log.Logger - if *logFormat == "json" { - logger = log.NewJSONLogger(log.NewSyncWriter(os.Stderr)) - } else { - logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) - } - switch *logLevel { - case "debug": - logger = level.NewFilter(logger, level.AllowDebug()) - case "info": - logger = level.NewFilter(logger, level.AllowInfo()) - case "warn": - logger = level.NewFilter(logger, level.AllowWarn()) - case "error": - logger = level.NewFilter(logger, level.AllowError()) - default: - logger = level.NewFilter(logger, level.AllowError()) - level.Error(logger).Log("msg", "Unrecognized log level", "level", *logLevel) - os.Exit(1) - } - logger = log.With(logger, "ts", timestampFormat, "caller", log.DefaultCaller) + logger := promslog.New(promslogConfig) var config *rest.Config var err error if *kubeconfig == "" { - level.Info(logger).Log("msg", "Loading in cluster kubeconfig", "kubeconfig", *kubeconfig) + logger.Info("Loading in cluster kubeconfig", "kubeconfig", *kubeconfig) config, err = rest.InClusterConfig() } else { - level.Info(logger).Log("msg", "Loading kubeconfig", "kubeconfig", *kubeconfig) + logger.Info("Loading kubeconfig", "kubeconfig", *kubeconfig) config, err = clientcmd.BuildConfigFromFlags("", *kubeconfig) } if err != nil { - level.Error(logger).Log("msg", "Error loading kubeconfig", "err", err) + logger.Error("Error loading kubeconfig", "err", err) os.Exit(1) } clientset, err := kubernetes.NewForConfig(config) if err != nil { - level.Error(logger).Log("msg", "Unable to generate Clientset", "err", err) + logger.Error("Unable to generate Clientset", "err", err) os.Exit(1) } - level.Info(logger).Log("msg", fmt.Sprintf("Starting %s", appName), "version", version.Info()) - level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext()) + logger.Info(fmt.Sprintf("Starting %s", appName), "version", version.Info()) + logger.Info("Build context", "build_context", version.BuildContext()) http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(` @@ -182,7 +159,7 @@ func main() { go func() { if err := http.ListenAndServe(*listenAddress, nil); err != nil { - level.Error(logger).Log("msg", "Error starting HTTP server", "err", err) + logger.Error("Error starting HTTP server", "err", err) os.Exit(1) } }() @@ -201,43 +178,43 @@ func main() { if *runOnce { os.Exit(errNum) } else { - level.Debug(logger).Log("msg", "Sleeping for interval", "interval", fmt.Sprintf("%.0f", (*reapInterval).Seconds())) + logger.Debug("Sleeping for interval", "interval", fmt.Sprintf("%.0f", (*reapInterval).Seconds())) time.Sleep(*reapInterval) } } } -func run(clientset kubernetes.Interface, logger log.Logger) error { +func run(clientset kubernetes.Interface, logger *slog.Logger) error { namespaces, err := getNamespaces(clientset, logger) if err != nil { - level.Error(logger).Log("msg", "Error getting namespaces", "err", err) + logger.Error("Error getting namespaces", "err", err) return err } jobs, jobIDs, err := getJobs(clientset, namespaces, logger) if err != nil { - level.Error(logger).Log("msg", "Error getting jods", "err", err) + logger.Error("Error getting jods", "err", err) return err } orphanedObjects, err := getOrphanedJobObjects(clientset, jobs, jobIDs, namespaces, logger) if err != nil { - level.Error(logger).Log("msg", "Error getting orphaned objects", "err", err) + logger.Error("Error getting orphaned objects", "err", err) } jobObjects, err := getJobObjects(clientset, jobs, logger) if err != nil { - level.Error(logger).Log("msg", "Error getting job objects", "err", err) + logger.Error("Error getting job objects", "err", err) return err } jobObjects = append(jobObjects, orphanedObjects...) errCount := reap(clientset, jobObjects, logger) if errCount > 0 { err := fmt.Errorf("%d errors encountered during reap", errCount) - level.Error(logger).Log("msg", err) + logger.Error(err.Error()) return err } return nil } -func getNamespaces(clientset kubernetes.Interface, logger log.Logger) ([]string, error) { +func getNamespaces(clientset kubernetes.Interface, logger *slog.Logger) ([]string, error) { var namespaces []string namespaces = strings.Split(*reapNamespaces, ",") if len(namespaces) == 1 && strings.ToLower(namespaces[0]) == "all" { @@ -250,13 +227,13 @@ func getNamespaces(clientset kubernetes.Interface, logger log.Logger) ([]string, nsListOptions := metav1.ListOptions{ LabelSelector: label, } - level.Debug(logger).Log("msg", "Getting namespaces with label", "label", label) + logger.Debug("Getting namespaces with label", "label", label) ns, err := clientset.CoreV1().Namespaces().List(context.TODO(), nsListOptions) if err != nil { - level.Error(logger).Log("msg", "Error getting namespace list", "label", label, "err", err) + logger.Error("Error getting namespace list", "label", label, "err", err) return nil, err } - level.Debug(logger).Log("msg", "Namespaces returned", "count", len(ns.Items)) + logger.Debug("Namespaces returned", "count", len(ns.Items)) for _, namespace := range ns.Items { namespaces = append(namespaces, namespace.Name) } @@ -266,7 +243,7 @@ func getNamespaces(clientset kubernetes.Interface, logger log.Logger) ([]string, return namespaces, nil } -func getJobs(clientset kubernetes.Interface, namespaces []string, logger log.Logger) ([]podJob, []string, error) { +func getJobs(clientset kubernetes.Interface, namespaces []string, logger *slog.Logger) ([]podJob, []string, error) { labels := strings.Split(*objectLabels, ",") jobs := []podJob{} jobIDs := []string{} @@ -278,47 +255,47 @@ func getJobs(clientset kubernetes.Interface, namespaces []string, logger log.Log } pods, err := clientset.CoreV1().Pods(ns).List(context.TODO(), listOptions) if err != nil { - level.Error(logger).Log("msg", "Error getting pod list", "label", l, "namespace", ns, "err", err) + logger.Error("Error getting pod list", "label", l, "namespace", ns, "err", err) metricErrorsTotal.Inc() return nil, nil, err } for _, pod := range pods.Items { - podLogger := log.With(logger, "pod", pod.Name, "namespace", pod.Namespace) + podLogger := logger.With("pod", pod.Name, "namespace", pod.Namespace) var jobID string if val, ok := pod.Labels[*jobLabel]; ok { - level.Debug(podLogger).Log("msg", "Pod has job label", "job", val) + podLogger.Debug("Pod has job label", "job", val) jobID = val } else if *jobLabel == "none" { - level.Debug(podLogger).Log("msg", "Ignoring absense of job label", "job", "none") + podLogger.Debug("Ignoring absense of job label", "job", "none") jobID = "none" } else { - level.Debug(podLogger).Log("msg", "Pod does not have job label, skipping") + podLogger.Debug("Pod does not have job label, skipping") continue } if !sliceContains(jobIDs, jobID) { jobIDs = append(jobIDs, jobID) } if *reapMax != 0 && toReap >= *reapMax { - level.Info(logger).Log("msg", "Max reap reached, skipping rest", "max", *reapMax) + logger.Info("Max reap reached, skipping rest", "max", *reapMax) continue } var lifetime time.Duration if val, ok := pod.Annotations[lifetimeAnnotation]; !ok { - level.Debug(podLogger).Log("msg", "Pod lacks reaper annotation, skipping", "annotation", lifetimeAnnotation) + podLogger.Debug("Pod lacks reaper annotation, skipping", "annotation", lifetimeAnnotation) continue } else { - level.Debug(podLogger).Log("msg", "Found pod with reaper annotation", "annotation", val) + podLogger.Debug("Found pod with reaper annotation", "annotation", val) lifetime, err = time.ParseDuration(val) if err != nil { - level.Error(podLogger).Log("msg", "Error parsing annotation, SKIPPING", "annotation", val, "err", err) + podLogger.Error("Error parsing annotation, SKIPPING", "annotation", val, "err", err) metricErrorsTotal.Inc() continue } } currentLifetime := timeNow().Sub(pod.CreationTimestamp.Time) - level.Debug(podLogger).Log("msg", "Pod lifetime", "lifetime", currentLifetime.Seconds()) + podLogger.Debug("Pod lifetime", "lifetime", currentLifetime.Seconds()) if currentLifetime > lifetime { - level.Debug(podLogger).Log("msg", "Pod is past its lifetime and will be killed.") + podLogger.Debug("Pod is past its lifetime and will be killed.") job := podJob{jobID: jobID, podName: pod.Name, namespace: pod.Namespace} jobs = append(jobs, job) } @@ -328,74 +305,74 @@ func getJobs(clientset kubernetes.Interface, namespaces []string, logger log.Log return jobs, jobIDs, nil } -func getOrphanedJobObjects(clientset kubernetes.Interface, jobs []podJob, jobIDs []string, namespaces []string, logger log.Logger) ([]jobObject, error) { - level.Debug(logger).Log("msg", "JobIDs to evaluate being orphaned", "jobIDs", strings.Join(jobIDs, ",")) +func getOrphanedJobObjects(clientset kubernetes.Interface, jobs []podJob, jobIDs []string, namespaces []string, logger *slog.Logger) ([]jobObject, error) { + logger.Debug("JobIDs to evaluate being orphaned", "jobIDs", strings.Join(jobIDs, ",")) jobObjects := []jobObject{} labels := strings.Split(*objectLabels, ",") for _, namespace := range namespaces { - orphanedLogger := log.With(logger, "namespace", namespace) + orphanedLogger := logger.With("namespace", namespace) for _, l := range labels { listOptions := metav1.ListOptions{ LabelSelector: l, } services, err := clientset.CoreV1().Services(namespace).List(context.TODO(), listOptions) if err != nil { - level.Error(orphanedLogger).Log("msg", "Error getting services", "err", err) + orphanedLogger.Error("Error getting services", "err", err) metricErrorsTotal.Inc() return nil, err } for _, service := range services.Items { if val, ok := service.Labels[*jobLabel]; ok { - level.Debug(orphanedLogger).Log("msg", "Service has job label", "job", val) + orphanedLogger.Debug("Service has job label", "job", val) if !sliceContains(jobIDs, val) { - level.Debug(orphanedLogger).Log("msg", "Found orphaned Service", "job", val, "name", service.Name, "namespace", service.Namespace) + orphanedLogger.Debug("Found orphaned Service", "job", val, "name", service.Name, "namespace", service.Namespace) jobObject := jobObject{objectType: "service", jobID: val, name: service.Name, namespace: service.Namespace} jobObjects = append(jobObjects, jobObject) } else { - level.Debug(orphanedLogger).Log("msg", "Service is not orphaned", "job", val, "name", service.Name, "namespace", service.Namespace) + orphanedLogger.Debug("Service is not orphaned", "job", val, "name", service.Name, "namespace", service.Namespace) } } else { - level.Debug(orphanedLogger).Log("msg", "Service lacks job label", "name", service.Name, "namespace", service.Namespace) + orphanedLogger.Debug("Service lacks job label", "name", service.Name, "namespace", service.Namespace) } } configmaps, err := clientset.CoreV1().ConfigMaps(namespace).List(context.TODO(), listOptions) if err != nil { - level.Error(orphanedLogger).Log("msg", "Error getting config maps", "err", err) + orphanedLogger.Error("Error getting config maps", "err", err) metricErrorsTotal.Inc() return nil, err } for _, configmap := range configmaps.Items { if val, ok := configmap.Labels[*jobLabel]; ok { - level.Debug(orphanedLogger).Log("msg", "ConfigMap has job label", "job", val) + orphanedLogger.Debug("ConfigMap has job label", "job", val) if !sliceContains(jobIDs, val) { - level.Debug(orphanedLogger).Log("msg", "Found orphaned ConfigMap", "job", val, "name", configmap.Name, "namespace", configmap.Namespace) + orphanedLogger.Debug("Found orphaned ConfigMap", "job", val, "name", configmap.Name, "namespace", configmap.Namespace) jobObject := jobObject{objectType: "configmap", jobID: val, name: configmap.Name, namespace: configmap.Namespace} jobObjects = append(jobObjects, jobObject) } else { - level.Debug(orphanedLogger).Log("msg", "ConfigMap is not orphaned", "job", val, "name", configmap.Name, "namespace", configmap.Namespace) + orphanedLogger.Debug("ConfigMap is not orphaned", "job", val, "name", configmap.Name, "namespace", configmap.Namespace) } } else { - level.Debug(orphanedLogger).Log("msg", "ConfigMap lacks job label", "name", configmap.Name, "namespace", configmap.Namespace) + orphanedLogger.Debug("ConfigMap lacks job label", "name", configmap.Name, "namespace", configmap.Namespace) } } secrets, err := clientset.CoreV1().Secrets(namespace).List(context.TODO(), listOptions) if err != nil { - level.Error(orphanedLogger).Log("msg", "Error getting secrets", "err", err) + orphanedLogger.Error("Error getting secrets", "err", err) metricErrorsTotal.Inc() return nil, err } for _, secret := range secrets.Items { if val, ok := secret.Labels[*jobLabel]; ok { - level.Debug(orphanedLogger).Log("msg", "Secret has job label", "job", val) + orphanedLogger.Debug("Secret has job label", "job", val) if !sliceContains(jobIDs, val) { - level.Debug(orphanedLogger).Log("msg", "Found orphaned Secret", "job", val, "name", secret.Name, "namespace", secret.Namespace) + orphanedLogger.Debug("Found orphaned Secret", "job", val, "name", secret.Name, "namespace", secret.Namespace) jobObject := jobObject{objectType: "secret", jobID: val, name: secret.Name, namespace: secret.Namespace} jobObjects = append(jobObjects, jobObject) } else { - level.Debug(orphanedLogger).Log("msg", "Secret is not orphaned", "job", val, "name", secret.Name, "namespace", secret.Namespace) + orphanedLogger.Debug("Secret is not orphaned", "job", val, "name", secret.Name, "namespace", secret.Namespace) } } else { - level.Debug(orphanedLogger).Log("msg", "Secret lacks job label", "name", secret.Name, "namespace", secret.Namespace) + orphanedLogger.Debug("Secret lacks job label", "name", secret.Name, "namespace", secret.Namespace) } } } @@ -403,13 +380,13 @@ func getOrphanedJobObjects(clientset kubernetes.Interface, jobs []podJob, jobIDs return jobObjects, nil } -func getJobObjects(clientset kubernetes.Interface, jobs []podJob, logger log.Logger) ([]jobObject, error) { +func getJobObjects(clientset kubernetes.Interface, jobs []podJob, logger *slog.Logger) ([]jobObject, error) { jobObjects := []jobObject{} for _, job := range jobs { jobObjects = append(jobObjects, jobObject{objectType: "pod", jobID: job.jobID, name: job.podName, namespace: job.namespace}) - jobLogger := log.With(logger, "job", job.jobID, "namespace", job.namespace) + jobLogger := logger.With("job", job.jobID, "namespace", job.namespace) if job.jobID == "none" { - level.Debug(jobLogger).Log("msg", "Job ID is none, skipping search for additional objects") + jobLogger.Debug("Job ID is none, skipping search for additional objects") continue } listOptions := metav1.ListOptions{ @@ -417,7 +394,7 @@ func getJobObjects(clientset kubernetes.Interface, jobs []podJob, logger log.Log } services, err := clientset.CoreV1().Services(job.namespace).List(context.TODO(), listOptions) if err != nil { - level.Error(jobLogger).Log("msg", "Error getting services", "err", err) + jobLogger.Error("Error getting services", "err", err) metricErrorsTotal.Inc() return nil, err } @@ -427,7 +404,7 @@ func getJobObjects(clientset kubernetes.Interface, jobs []podJob, logger log.Log } configmaps, err := clientset.CoreV1().ConfigMaps(job.namespace).List(context.TODO(), listOptions) if err != nil { - level.Error(jobLogger).Log("msg", "Error getting config maps", "err", err) + jobLogger.Error("Error getting config maps", "err", err) metricErrorsTotal.Inc() return nil, err } @@ -437,7 +414,7 @@ func getJobObjects(clientset kubernetes.Interface, jobs []podJob, logger log.Log } secrets, err := clientset.CoreV1().Secrets(job.namespace).List(context.TODO(), listOptions) if err != nil { - level.Error(jobLogger).Log("msg", "Error getting secrets", "err", err) + jobLogger.Error("Error getting secrets", "err", err) metricErrorsTotal.Inc() return nil, err } @@ -449,62 +426,62 @@ func getJobObjects(clientset kubernetes.Interface, jobs []podJob, logger log.Log return jobObjects, nil } -func reap(clientset kubernetes.Interface, jobObjects []jobObject, logger log.Logger) int { +func reap(clientset kubernetes.Interface, jobObjects []jobObject, logger *slog.Logger) int { deletedPods := 0 deletedServices := 0 deletedConfigMaps := 0 deletedSecrets := 0 errCount := 0 for _, job := range jobObjects { - reapLogger := log.With(logger, "job", job.jobID, "name", job.name, "namespace", job.namespace) + reapLogger := logger.With("job", job.jobID, "name", job.name, "namespace", job.namespace) switch job.objectType { case "pod": err := clientset.CoreV1().Pods(job.namespace).Delete(context.TODO(), job.name, metav1.DeleteOptions{}) if err != nil { errCount++ - level.Error(reapLogger).Log("msg", "Error deleting pod", "err", err) + reapLogger.Error("Error deleting pod", "err", err) metricErrorsTotal.Inc() continue } - level.Info(reapLogger).Log("msg", "Pod deleted") + reapLogger.Info("Pod deleted") metricReapedTotal.With(prometheus.Labels{"type": "pod"}).Inc() deletedPods++ case "service": err := clientset.CoreV1().Services(job.namespace).Delete(context.TODO(), job.name, metav1.DeleteOptions{}) if err != nil { errCount++ - level.Error(reapLogger).Log("msg", "Error deleting service", "err", err) + reapLogger.Error("Error deleting service", "err", err) metricErrorsTotal.Inc() continue } - level.Info(reapLogger).Log("msg", "Service deleted") + reapLogger.Info("Service deleted") metricReapedTotal.With(prometheus.Labels{"type": "service"}).Inc() deletedServices++ case "configmap": err := clientset.CoreV1().ConfigMaps(job.namespace).Delete(context.TODO(), job.name, metav1.DeleteOptions{}) if err != nil { errCount++ - level.Error(reapLogger).Log("msg", "Error deleting config map", "err", err) + reapLogger.Error("Error deleting config map", "err", err) metricErrorsTotal.Inc() continue } - level.Info(reapLogger).Log("msg", "ConfigMap deleted") + reapLogger.Info("ConfigMap deleted") metricReapedTotal.With(prometheus.Labels{"type": "configmap"}).Inc() deletedConfigMaps++ case "secret": err := clientset.CoreV1().Secrets(job.namespace).Delete(context.TODO(), job.name, metav1.DeleteOptions{}) if err != nil { errCount++ - level.Error(reapLogger).Log("msg", "Error deleting secret", "err", err) + reapLogger.Error("Error deleting secret", "err", err) metricErrorsTotal.Inc() continue } - level.Info(reapLogger).Log("msg", "Secret deleted") + reapLogger.Info("Secret deleted") metricReapedTotal.With(prometheus.Labels{"type": "secret"}).Inc() deletedSecrets++ } } - level.Info(logger).Log("msg", "Reap summary", + logger.Info("Reap summary", "pods", deletedPods, "services", deletedServices, "configmaps", deletedConfigMaps, diff --git a/main_test.go b/main_test.go index e6e7390..7432eef 100644 --- a/main_test.go +++ b/main_test.go @@ -15,6 +15,7 @@ package main import ( "context" + "log/slog" "os" "reflect" "sort" @@ -22,9 +23,8 @@ import ( "testing" "time" - "github.com/go-kit/log" + "github.com/alecthomas/kingpin/v2" "github.com/prometheus/client_golang/prometheus/testutil" - kingpin "gopkg.in/alecthomas/kingpin.v2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -208,8 +208,7 @@ func TestGetNamespaces(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) clientset := clientset() namespaces, err := getNamespaces(clientset, logger) if err != nil { @@ -227,8 +226,7 @@ func TestGetNamespacesByLabel(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--namespace-labels=app.kubernetes.io/name=open-ondemand"}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) clientset := clientset() namespaces, err := getNamespaces(clientset, logger) if err != nil { @@ -246,8 +244,7 @@ func TestGetJobs(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--object-labels=app.kubernetes.io/managed-by=open-ondemand"}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 15:00:00") @@ -289,8 +286,7 @@ func TestGetJobsCase1(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--object-labels=app.kubernetes.io/managed-by=open-ondemand"}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 13:45:00") @@ -319,8 +315,7 @@ func TestGetJobsNoPodLabels(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 15:00:00") @@ -355,8 +350,7 @@ func TestGetJobsNamespaceLabels(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--namespace-labels=app.kubernetes.io/name=open-ondemand"}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 15:00:00") @@ -385,8 +379,7 @@ func TestGetJobsNoJobLabel(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--job-label=none"}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 15:00:00") @@ -429,8 +422,7 @@ func TestRunOnDemand(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--object-labels=app.kubernetes.io/managed-by=open-ondemand"}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 15:00:00") @@ -497,8 +489,7 @@ func TestRun(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 15:00:00") @@ -565,8 +556,7 @@ func TestRunNoJobLabel(t *testing.T) { if _, err := kingpin.CommandLine.Parse([]string{"--job-label=none"}); err != nil { t.Fatal(err) } - w := log.NewSyncWriter(os.Stderr) - logger := log.NewLogfmtLogger(w) + logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) timeNow = func() time.Time { t, _ := time.Parse("01/02/2006 15:04:05", "01/01/2020 15:00:00")