Skip to content

Fixes CI: makes golangci-lint use Go version from go.mod #2935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/sanity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version-file: "go.mod"
- name: Run linting checks
uses: "golangci/golangci-lint-action@v2"
uses: "golangci/golangci-lint-action@v3"
with:
version: "v1.46.0"
version: "v1.50.1"
10 changes: 6 additions & 4 deletions pkg/controller/operators/olm/overrides/inject/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,12 @@ func InjectNodeSelectorIntoDeployment(podSpec *corev1.PodSpec, nodeSelector map[
// with the given corev1.Affinity. Any nil top-level sub-attributes (e.g. NodeAffinity, PodAffinity, and PodAntiAffinity)
// will be ignored. Hint: to overwrite those top-level attributes, empty them out. I.e. use the empty/default object ({})
// e.g. NodeAffinity{}. In yaml:
// affinity:
// nodeAffinity: {}
// podAffinity: {}
// podAntiAffinity: {}
//
// affinity:
// nodeAffinity: {}
// podAffinity: {}
// podAntiAffinity: {}
//
Comment on lines +238 to +243
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a whitespace change, what caused it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gofmt was not happy about this comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oi!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were some changes in Go 1.19 related to gofmt and doc comments: https://tip.golang.org/doc/go1.19

I don’t know why v2 action with Go 1.19 did not complain about it. My guess is that v2 action was shipping own version of gofmt which was older.

// will completely remove the deployment podSpec.affinity and is equivalent to
// affinity: {}
func OverrideDeploymentAffinity(podSpec *corev1.PodSpec, affinity *corev1.Affinity) error {
Expand Down