diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dad88380..5744d81b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) +- (Maintenance) Add govulncheck to pipeline, update golangci-linter ## [1.2.28](https://github.com/arangodb/kube-arangodb/tree/1.2.28) (2023-06-05) - (Feature) ArangoBackup create retries and MaxIterations limit diff --git a/Makefile b/Makefile index 81fe7c50f..d838eb86d 100644 --- a/Makefile +++ b/Makefile @@ -224,7 +224,7 @@ PROTOSOURCES := $(shell find ./ -type f -name '*.proto' $(foreach EXCLUDE_DIR,$ all: check-vars verify-generated build .PHONY: compile -compile: check-vars build +compile: check-vars build # allall is now obsolete .PHONY: allall @@ -277,6 +277,11 @@ linter: linter-fix: @$(GOPATH)/bin/golangci-lint run --fix --build-tags "$(RELEASE_MODE)" $(foreach LINT_EXCLUDE,$(LINT_EXCLUDES),--exclude '$(LINT_EXCLUDE)') ./... +.PHONY: vulncheck +vulncheck: + @echo ">> Checking for known vulnerabilities" + @$(GOPATH)/bin/govulncheck --tags $(RELEASE_MODE) ./... + .PHONY: build build: docker manifests @@ -533,7 +538,7 @@ init: vendor tools update-generated $(BIN) .PHONY: tools-min tools-min: update-vendor @echo ">> Fetching golangci-lint linter" - @GOBIN=$(GOPATH)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1 + @GOBIN=$(GOPATH)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2 @echo ">> Fetching goimports" @GOBIN=$(GOPATH)/bin go install golang.org/x/tools/cmd/goimports@0bb7e5c47b1a31f85d4f173edc878a8e049764a5 @echo ">> Fetching license check" @@ -555,6 +560,8 @@ tools: tools-min @echo ">> Fetching protoc go plugins..." @GOBIN=$(GOPATH)/bin go install github.com/golang/protobuf/protoc-gen-go@v1.5.2 @GOBIN=$(GOPATH)/bin go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 + @echo ">> Fetching govulncheck" + @GOBIN=$(GOPATH)/bin go install golang.org/x/vuln/cmd/govulncheck@v0.1.0 .PHONY: vendor vendor: @@ -635,7 +642,7 @@ check-community: @$(MAKE) _check RELEASE_MODE=community _check: sync-crds - @$(MAKE) fmt yamlfmt license-verify linter run-unit-tests bin + @$(MAKE) fmt yamlfmt license-verify linter run-unit-tests bin vulncheck generate: generate-internal generate-proto fmt diff --git a/pkg/deployment/resources/env_builder.go b/pkg/deployment/resources/env_builder.go index 57c2d84cc..1589fd193 100644 --- a/pkg/deployment/resources/env_builder.go +++ b/pkg/deployment/resources/env_builder.go @@ -1,5 +1,5 @@ // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ func (e *EnvBuilder) Add(override bool, envs ...core.EnvVar) (modified bool) { if id, ok := e.getID(env); ok { if override { (*e)[id] = env - modified = true } } diff --git a/pkg/deployment/resources/inspector/sm.go b/pkg/deployment/resources/inspector/sm.go index d3036b1c0..ec5cfb18e 100644 --- a/pkg/deployment/resources/inspector/sm.go +++ b/pkg/deployment/resources/inspector/sm.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -102,16 +102,12 @@ func (p serviceMonitorsInspectorLoader) getV1ServiceMonitorsList(ctx context.Con ptrs := make([]*monitoring.ServiceMonitor, 0, s) for { - for id := range items { - ptrs = append(ptrs, items[id]) - } - + ptrs = append(ptrs, items...) if cont == "" { break } items, cont, err = p.getV1ServiceMonitorsListRequest(ctx, i, cont) - if err != nil { return nil, err }