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: fix usage of local golangci-lint installation #28162
build: fix usage of local golangci-lint installation #28162
Conversation
/test |
Interestingly, my locally installed
I guess this is because I installed it using |
Interesting find. I wondered why this is "suddenly" no longer working. I was pretty sure that this worked even after introducing automated Renovate upgrades. Currently i have it installed via their recommended "binaries" approach. What's the output of |
But I guess we cannot rely on that format. Presumably developers will also use the prebuilt binaries so we should probably assume both version formats for the purpose of the |
Oh it seems that they also differ in the short version :( Guess i have to remove the prefix anyway |
The make target `make lint` should prefer the locally installed `golangci-lint` if the installed version matches the expected one. This comes with the advantage of using the local cache. This behaviour is broken since cilium#24664 (automate golangci-lint upgrades with renovate). This commit re-introduces the feature. Fixes: cilium#24664 Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
ae730ae
to
bbd46f9
Compare
/test |
This will print just the version, no Go version or other information not relevant for the version check. Ref. cilium/cilium#28162 Suggested-by: Marco Hofstetter <marco.hofstetter@isovalent.com> Signed-off-by: Tobias Klauser <tobias@cilium.io>
This will print just the version, no Go version or other information not relevant for the version check. Ref. cilium/cilium#28162 Suggested-by: Marco Hofstetter <marco.hofstetter@isovalent.com> Signed-off-by: Tobias Klauser <tobias@cilium.io>
The make target
make lint
should prefer the locally installedgolangci-lint
if the installed version matches the expected one. This comes with the advantage of using the local cache.It seems that there are differences in the version representation between the upstream binaries (including the
v
prefix) and the one installed viago install ...
(without the prefix). The current implementation doesn't support the upstream binaries with thev
prefix - it always falls back to executing the docker version.This commit introduces support for both formats by stripping any given
v
prefix before comparison.