Skip to content
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

build: bump golangci-lint version in build image #3195

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

hairyhum
Copy link
Contributor

Change Overview

Old version of golangci-lint has a memory leak causing it to crash with oom in recent go versions.
Updated golangci-lint version in build image.
Fixed lint errors.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test
  • 🏗️ Build

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

Old versio of golangci-lint has a memory leak causing it to crash with oom in recent go versions.
Updated golangci-lint version.
Fixed some lint errors.
@@ -55,22 +55,22 @@ func (*deleteRDSSnapshotFunc) Name() string {
return DeleteRDSSnapshotFuncName
}

func deleteRDSSnapshot(ctx context.Context, snapshotID string, profile *param.Profile, dbEngine RDSDBEngine) (map[string]interface{}, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes an unparam linter warning.

Copy link
Contributor

Choose a reason for hiding this comment

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

@KastenMike I am assuming this was flagged by a linter as part of the upgrade. @hairyhum can confirm.

If that's the case, there are 2 options:

  • Put all the changes in a single PR, like this one; or
  • 2 PRs in this order: the first one addressing the linter warnings, and the second one upgrading the linter version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Upgrading linter version is a github action, which I've already run, so it's just a matter of getting it to the master codebase

@@ -134,7 +134,7 @@ func createVolumeSnapshot(ctx context.Context, tp param.TemplateParams, cli kube
}
wg.Wait()

err := fmt.Errorf(strings.Join(errstrings, "\n"))
err := fmt.Errorf("%s", strings.Join(errstrings, "\n"))
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that this should use errors.New

Suggested change
err := fmt.Errorf("%s", strings.Join(errstrings, "\n"))
err := errors.New(strings.Join(errstrings, "\n"))

Question unrelated to this PR why are newlines (\n) being used inside the error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or maybe errkit, but I was trying to keep the changes minimal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to errkit because we already have it in this file.

Copy link
Contributor

@julio-lopez julio-lopez left a comment

Choose a reason for hiding this comment

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

LG. See minor comment

@hairyhum hairyhum added the kueue label Oct 23, 2024
@mergify mergify bot merged commit fa2649b into master Oct 23, 2024
18 checks passed
@mergify mergify bot deleted the fix-golangci-memory-leak branch October 23, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants