1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Add govulncheck to pipeline, update golangci-linter (#1302)

* Add govulncheck to pipeline, update golangci-linter

Two linter warnings fixed to pass the build

* Add to Travis

* Do not fail build on 1.19

* Remove vulncheck from travisCI

---------

Co-authored-by: Adam Janikowski <12255597+ajanikow@users.noreply.github.com>
This commit is contained in:
Nikita Vaniasin 2023-06-05 20:46:18 +02:00 committed by GitHub
parent b8ef2de01e
commit 3a5f04240c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 11 deletions

View file

@ -1,6 +1,7 @@
# Change Log # Change Log
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) ## [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) ## [1.2.28](https://github.com/arangodb/kube-arangodb/tree/1.2.28) (2023-06-05)
- (Feature) ArangoBackup create retries and MaxIterations limit - (Feature) ArangoBackup create retries and MaxIterations limit

View file

@ -277,6 +277,11 @@ linter:
linter-fix: linter-fix:
@$(GOPATH)/bin/golangci-lint run --fix --build-tags "$(RELEASE_MODE)" $(foreach LINT_EXCLUDE,$(LINT_EXCLUDES),--exclude '$(LINT_EXCLUDE)') ./... @$(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 .PHONY: build
build: docker manifests build: docker manifests
@ -533,7 +538,7 @@ init: vendor tools update-generated $(BIN)
.PHONY: tools-min .PHONY: tools-min
tools-min: update-vendor tools-min: update-vendor
@echo ">> Fetching golangci-lint linter" @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" @echo ">> Fetching goimports"
@GOBIN=$(GOPATH)/bin go install golang.org/x/tools/cmd/goimports@0bb7e5c47b1a31f85d4f173edc878a8e049764a5 @GOBIN=$(GOPATH)/bin go install golang.org/x/tools/cmd/goimports@0bb7e5c47b1a31f85d4f173edc878a8e049764a5
@echo ">> Fetching license check" @echo ">> Fetching license check"
@ -555,6 +560,8 @@ tools: tools-min
@echo ">> Fetching protoc go plugins..." @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 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 @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 .PHONY: vendor
vendor: vendor:
@ -635,7 +642,7 @@ check-community:
@$(MAKE) _check RELEASE_MODE=community @$(MAKE) _check RELEASE_MODE=community
_check: sync-crds _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 generate: generate-internal generate-proto fmt

View file

@ -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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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 id, ok := e.getID(env); ok {
if override { if override {
(*e)[id] = env (*e)[id] = env
modified = true
} }
} }

View file

@ -1,7 +1,7 @@
// //
// DISCLAIMER // 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"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with 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) ptrs := make([]*monitoring.ServiceMonitor, 0, s)
for { for {
for id := range items { ptrs = append(ptrs, items...)
ptrs = append(ptrs, items[id])
}
if cont == "" { if cont == "" {
break break
} }
items, cont, err = p.getV1ServiceMonitorsListRequest(ctx, i, cont) items, cont, err = p.getV1ServiceMonitorsListRequest(ctx, i, cont)
if err != nil { if err != nil {
return nil, err return nil, err
} }