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

fix go vet errors with Go 1.24 #41076

Merged
merged 13 commits into from
Oct 21, 2024
Merged

Conversation

mauri870
Copy link
Member

@mauri870 mauri870 commented Oct 2, 2024

Proposed commit message

The cmd/vet in Go 1.24 reports printf calls with non-const format and no args, causing failures. Additionally, I had to resolve linter issues in the affected files. One particular linter error was actually a vulnerability related to path traversal for zip and tar files.

See https://go.dev/issues/60529

How to test this PR locally

$ go install golang.org/dl/gotip@latest
$ gotip download
$ gotip vet ./...

Related issues

The cmd/vet in Go 1.24 reports printf calls with non-const format and no args, causing failures.

```
$ go install golang.org/dl/gotip@latest
$ gotip download
$ gotip vet ./...
```
@mauri870 mauri870 added cleanup Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Oct 2, 2024
@mauri870 mauri870 self-assigned this Oct 2, 2024
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 2, 2024
Copy link
Contributor

mergify bot commented Oct 2, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @mauri870? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Oct 2, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Oct 2, 2024
@mauri870 mauri870 marked this pull request as ready for review October 11, 2024 16:11
@mauri870 mauri870 requested review from a team as code owners October 11, 2024 16:11
@mauri870 mauri870 requested a review from gizas October 11, 2024 16:11
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

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

Heartbeat changes LGTM

libbeat/cmd/instance/beat.go Show resolved Hide resolved
libbeat/cmd/instance/beat.go Show resolved Hide resolved
libbeat/cmd/instance/beat.go Show resolved Hide resolved
packetbeat/beater/processor.go Show resolved Hide resolved
@mauri870 mauri870 requested a review from rdner October 15, 2024 14:23
Copy link
Member

@rdner rdner left a comment

Choose a reason for hiding this comment

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

Thanks for answering my questions, looks good to me.

@pierrehilbert
Copy link
Collaborator

@nfritts @bturquet could we have someone to review this please?

@mauri870 mauri870 enabled auto-merge (squash) October 18, 2024 13:11
@mauri870
Copy link
Member Author

@elastic/obs-cloudnative-monitoring Kindly requesting a review, thanks!

Copy link
Contributor

@gizas gizas left a comment

Choose a reason for hiding this comment

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

Approving for kubernetes changes.

nit: the sanitisation changes were not part of the issue description. Maybe to be added for clarification

@mauri870
Copy link
Member Author

Thanks! Updated the description to mention the rationale behind the sanitization changes.

@mauri870
Copy link
Member Author

@elastic/stack-monitoring Looks like I need a review from you as well. Thanks in advance.

@pierrehilbert
Copy link
Collaborator

@smith could we have someone here to review?

@consulthys
Copy link
Contributor

@pierrehilbert Sorry for the delay, I'll be taking a look

Copy link
Contributor

@consulthys consulthys left a comment

Choose a reason for hiding this comment

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

LGT Stack Monitoring

@pierrehilbert
Copy link
Collaborator

Thanks @consulthys

@pierrehilbert pierrehilbert merged commit 5de2287 into elastic:main Oct 21, 2024
142 checks passed
mergify bot pushed a commit that referenced this pull request Oct 21, 2024
* fix go vet errors with Go 1.24

The cmd/vet in Go 1.24 reports printf calls with non-const format and no args, causing failures.

```
$ go install golang.org/dl/gotip@latest
$ gotip download
$ gotip vet ./...
```

* use os.WriteFile

* more linter fixes

* even more linter fixes

* more more more linter fixes

* fix wrong variable name

* fix linter issues with emptyIface

(cherry picked from commit 5de2287)
oakrizan pushed a commit to oakrizan/beats that referenced this pull request Oct 21, 2024
* fix go vet errors with Go 1.24

The cmd/vet in Go 1.24 reports printf calls with non-const format and no args, causing failures.

```
$ go install golang.org/dl/gotip@latest
$ gotip download
$ gotip vet ./...
```

* use os.WriteFile

* more linter fixes

* even more linter fixes

* more more more linter fixes

* fix wrong variable name

* fix linter issues with emptyIface
mauri870 added a commit that referenced this pull request Oct 21, 2024
* fix go vet errors with Go 1.24

The cmd/vet in Go 1.24 reports printf calls with non-const format and no args, causing failures.

```
$ go install golang.org/dl/gotip@latest
$ gotip download
$ gotip vet ./...
```

* use os.WriteFile

* more linter fixes

* even more linter fixes

* more more more linter fixes

* fix wrong variable name

* fix linter issues with emptyIface

(cherry picked from commit 5de2287)

Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify cleanup Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants