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:
parent
b8ef2de01e
commit
3a5f04240c
4 changed files with 14 additions and 11 deletions
|
@ -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
|
||||
|
|
11
Makefile
11
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue