Skip to content

Commit

Permalink
Merge branch 'stackrox:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ariyonaty authored Jul 17, 2024
2 parents 197f903 + 90d63af commit 3ae972b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand Down
7 changes: 2 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
run:
timeout: 5m
go: "1.22"

issues:
exclude-use-default: false
Expand Down Expand Up @@ -45,23 +46,19 @@ linters-settings:
excludes:
- G101
gosimple:
go: "1.16"
checks: ["all"]
nolintlint:
allow-leading-space: false # require machine-readable nolint directives (i.e. with no leading space)
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
revive:
min-confidence: 0
confidence: 0
# Due to https://github.com/golangci/golangci-lint/issues/2355 on MacOS the linter is failing with the error
# message too many files. Set the max-open-files explicitly.
max-open-files: 2048
staticcheck:
go: "1.16"
checks: ["all"]
stylecheck:
go: "1.16"
checks: ["all", "-ST1000"]

linters:
Expand Down
23 changes: 7 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

.PHONY: none
none:


.PHONY: deps
deps: go.mod go.sum
@echo "+ $@"
@go mod tidy
Expand All @@ -22,12 +18,6 @@ GOBIN := $(CURDIR)/.gobin
DIST := $(CURDIR)/dist
PATH := $(DIST):$(GOBIN):$(PATH)

# Makefile on Mac doesn't pass the updated PATH and GOBIN to the shell
# and so, without the following line, the shell does not end up
# trying commands in $(GOBIN) first.
# See https://stackoverflow.com/a/36226784/3690207
SHELL := env GOBIN=$(GOBIN) PATH=$(PATH) /bin/bash

KUBE_LINTER_BIN := $(GOBIN)/kube-linter

COVFILES := $(shell mktemp -d)
Expand All @@ -39,12 +29,12 @@ COVFILES := $(shell mktemp -d)
GOLANGCILINT_BIN := $(GOBIN)/golangci-lint
$(GOLANGCILINT_BIN): deps
@echo "+ $@"
go install github.com/golangci/golangci-lint/cmd/golangci-lint
GOBIN=$(GOBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint

GORELEASER_BIN := $(GOBIN)/goreleaser
$(GORELEASER_BIN): deps
@echo "+ $@"
go install github.com/goreleaser/goreleaser
GOBIN=$(GOBIN) go install github.com/goreleaser/goreleaser

###########
## Lint ##
Expand All @@ -56,9 +46,9 @@ ifdef CI
@echo '+ $@'
@echo 'The environment indicates we are in CI; running linters in check mode.'
@echo 'If this fails, run `make lint`.'
golangci-lint run
$(GOLANGCILINT_BIN) run
else
golangci-lint run --fix
$(GOLANGCILINT_BIN) run --fix
endif

.PHONY: lint
Expand Down Expand Up @@ -89,7 +79,8 @@ generated-srcs: go-generated-srcs generated-docs
build: $(KUBE_LINTER_BIN)

$(KUBE_LINTER_BIN): $(GORELEASER_BIN) $(shell find . -type f -name '*.go')
goreleaser build --snapshot --clean
$(GORELEASER_BIN) build --snapshot --clean
mkdir -p $(GOBIN)
@cp "$(DIST)/kube-linter_$(HOST_OS)_amd64_v1/kube-linter" "$(GOBIN)/kube-linter"
@chmod u+w "$(GOBIN)/kube-linter"

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/openshift/api v0.0.0-20230406152840-ce21e3fe5da2
github.com/owenrumney/go-sarif/v2 v2.3.1
github.com/pkg/errors v0.9.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.0
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.1
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.19.0
Expand Down Expand Up @@ -427,7 +427,7 @@ require (
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240515191416-fc5f0ca64291 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/evanphx/json-patch.v5 v5.8.1 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -855,8 +855,8 @@ github.com/polyfloyd/go-errorlint v1.5.2 h1:SJhVik3Umsjh7mte1vE0fVZ5T1gznasQG3PV
github.com/polyfloyd/go-errorlint v1.5.2/go.mod h1:sH1QC1pxxi0fFecsVIzBmxtrgd9IF/SkJpA6wqyKAJs=
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.0 h1:62MgqpTrtjNd8cc0RJSFJ1OHqgSrThgHehGVuQaF/fc=
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.0/go.mod h1:XYrdZw5dW12Cjkt4ndbeNZZTBp4UCHtW0ccR9+sTtPU=
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.1 h1:+iiljhJV6niK7MuifJs/n3NeLxikd85nrQfn53sLJkU=
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.1/go.mod h1:XYrdZw5dW12Cjkt4ndbeNZZTBp4UCHtW0ccR9+sTtPU=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
Expand Down Expand Up @@ -1325,8 +1325,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
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.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0=
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=
Expand Down

0 comments on commit 3ae972b

Please sign in to comment.