kubernetes-sigs / kustomize

Customization of kubernetes YAML configurations
Apache License 2.0
10.7k stars 2.22k forks source link

go linter fails on github actions and locally #5694

Open mousamdahal opened 1 month ago

mousamdahal commented 1 month ago

What happened?

When the linter runs, it always fails even If I tried couple of configurations. Below is the error logs in verbose mode,

WARN [runner] Can't run linter goanalysis_metalinter: buildir: failed to load package openapi: could not load export data: no export data for "sigs.k8s.io/kustomize/kyaml/openapi" 
INFO [runner] processing took 4.372µs with stages: max_same_issues: 703ns, path_prettifier: 450ns, severity-rules: 384ns, cgo: 322ns, skip_dirs: 321ns, nolint: 245ns, max_from_linter: 224ns, fixer: 138ns, filename_unadjuster: 131ns, autogenerated_exclude: 129ns, exclude: 127ns, invalid_issue: 125ns, max_per_file_from_linter: 124ns, source_code: 123ns, skip_files: 123ns, diff: 122ns, path_prefixer: 122ns, uniq_by_line: 121ns, path_shortener: 110ns, exclude-rules: 110ns, identifier_marker: 67ns, sort_results: 51ns 
INFO [runner] linters took 34.198095437s with stages: goanalysis_metalinter: 34.198037061s 
ERRO Running error: can't run linter goanalysis_metalinter
buildir: failed to load package openapi: could not load export data: no export data for "sigs.k8s.io/kustomize/kyaml/openapi" 
INFO Memory: 305 samples, avg is 1035.6MB, max is 1710.7MB 

What did you expect to happen?

The linter should have been passed successfully

How can we reproduce it (as minimally and precisely as possible)?

Any project having dependency of sigs.k8s.io/kustomize/kyaml v0.13.9 , might fail

Expected output

No response

Actual output

No response

Kustomize version

sigs.k8s.io/kustomize/kyaml v0.13.9

Operating system

Linux

stormqueen1990 commented 1 month ago

Hi there, @mousamdahal!

Could you please provide more information about this? I am unclear what linter this issue is referring to, how is it being ran, and what configuration was used for that.

This project uses golangci-lint and I have not seen any recent concerns with it failing either locally or in CI.

/triage needs-information

KaanTolunayKilicOG commented 3 weeks ago

hi, same issue here

I have golangci-lint in version 1.59.0 running in github action and i get the following error message with -v enabled:

[runner] Can't run linter goanalysis_metalinter: inspect: failed to load package recon: could not load export data: no export data for "XXX"

go version is: go version go1.22.3 linux/amd64

Running golangci-lint locally with the same version on my mac works!

mousamdahal commented 3 weeks ago

@stormqueen1990 , so in my case, we are not directly using this project, but it gets added as an indirect dependency and the workflow we are using on GitHub action fails showing the error above, and it fails on my local system too (while running golangcilint on my project). Please pinpoint the logs or the version information, which you want me to share here.