Skip to content

Commit eaffa2e

Browse files
authored
chore: use infra-checkers static analysis settings and include known issue to trivyignore (#52)
1 parent 46747b4 commit eaffa2e

File tree

4 files changed

+11
-41
lines changed

4 files changed

+11
-41
lines changed

.github/workflows/push_pr.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@ jobs:
1919
runs-on: ubuntu-20.04
2020
steps:
2121
- uses: actions/checkout@v2
22+
- uses: actions/setup-go@v2
23+
with:
24+
go-version: ${{ env.GO_VERSION }}
2225
- uses: newrelic/newrelic-infra-checkers@v1
26+
with:
27+
golangci-lint-config: golangci-lint-limited
2328
- name: Semgrep
2429
uses: returntocorp/semgrep-action@v1
2530
with:
2631
auditOn: push
2732
- name: golangci-lint
28-
uses: golangci/golangci-lint-action@v2
33+
uses: golangci/golangci-lint-action@v3
2934
continue-on-error: ${{ github.event_name != 'pull_request' }}
3035
with:
3136
only-new-issues: true

.golangci.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.trivyignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# We are running the 2.16.0 version of github.com/emicklei/go-restful that had the fix backported, but trivy still points it out as false-positive
2+
# This is going to be fixed by 2.15 of the kubernetes client go, they decided not to backport the fix since they are not using the impacted feature.
3+
CVE-2022-1996

Makefile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,23 @@ IMAGE_NAME ?= newrelic/nri-discovery-kubernetes
88
GOPATH := $(shell go env GOPATH)
99
GORELEASER_VERSION := v0.168.0
1010
GORELEASER_BIN ?= bin/goreleaser
11-
GOLANGCI_LINT_BIN = golangci-lint
1211

1312
all: build
1413

15-
build: check-version clean validate test compile
14+
build: check-version clean test compile
1615

1716
clean:
1817
@echo "=== $(PROJECT) === [ clean ]: Removing binaries and coverage file..."
1918
@rm -rfv bin
2019
@rm -rfv target
2120

22-
tools: check-version
23-
@which $(GOLANGCI_LINT_BIN) || echo "golangci-lint not found in PATH" >&2 && exit 1
24-
2521
fmt:
2622
@go fmt ./...
2723

2824
deps:
2925
@echo "=== $(PROJECT) === [ deps ]: Installing package dependencies required by the project..."
3026
@go mod download
3127

32-
validate: deps
33-
@echo "=== $(PROJECT) === [ validate ]: Validating source code running golangci-lint..."
34-
@${GOLANGCI_LINT_BIN} --version
35-
@${GOLANGCI_LINT_BIN} run
36-
3728
compile: deps
3829
@echo "=== $(PROJECT) === [ compile ]: Building $(BINARY_NAME)..."
3930
@go build -o bin/$(BINARY_NAME) ./cmd/discovery/
@@ -71,4 +62,4 @@ endif
7162
include $(CURDIR)/build/ci.mk
7263
include $(CURDIR)/build/release.mk
7364

74-
.PHONY: all fmt build clean tools tools-update deps deps-only validate compile compile-only test check-version tools-golangci-lint docker-build release release/deps release/test docker-release
65+
.PHONY: all fmt build clean tools tools-update deps deps-only compile compile-only test check-version docker-build release release/deps release/test snyk snyk/monitor docker-release

0 commit comments

Comments
 (0)