chore: remove replace directives from go.mod#7821
Open
linkvt wants to merge 1 commit into
Open
Conversation
|
Thank you for your contribution! 🙏 Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected. While you are waiting, make sure to:
Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient. Learn more about our contribution guide. |
|
| Status | Scan Engine | Total (0) | ||||
|---|---|---|---|---|---|---|
| Open Source Security | 0 | 0 | 0 | 0 | See details |
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.
b6e9f96 to
075a87d
Compare
2 tasks
Member
Author
|
Edit: was a flake, forcepush fixed it |
1 task
controller-tools v0.21.0 declares k8s.io/* v0.36.0 in its go.mod, which forces Go's MVS to resolve k8s.io/client-go to v0.36.0. This is incompatible with controller-runtime v0.23.3 (missing HasSyncedChecker method). The replace directives were a workaround to force v0.35.5. Instead, downgrade controller-tools to v0.20.1 (which uses k8s.io v0.35.0) so MVS naturally resolves to v0.35.5. This eliminates the need for all 17 replace directives and fixes downstream consumers like http-add-on that don't inherit replace directives. Changes: - Downgrade sigs.k8s.io/controller-tools from v0.21.0 to v0.20.1 - Remove all replace directives pinning k8s.io, prometheus, and cel-go - Set k8s.io packages to v0.35.5 directly in require - Update vendored dependencies to match Signed-off-by: Vincent Link <vlink@redhat.com>
075a87d to
6524a02
Compare
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
replacedirectives in the go.mod are not transitive in Go, they only apply to the main module, not to downstream consumers like the HTTP Add-on and other projects (there seem to be quite a few based on reactions in #6660 or the recent comment in #7513).This means any project that depends on
github.com/kedacore/keda/v2does not inherit these pins and gets different (incompatible) dependency versions resolved by Go's MVS.Each of these projects needs to add replace directives on their own and their dependents also need to do that afterwards.
From what I know there is no reason at all to require both on higher versions and replace them with lower ones, we can just require the actual versions we support from the start.
keda should IMO consider the effect of its dependency tree on downstream projects as we have to depend on keda to implement the external scaler interface.
Happy to discuss these things, creating the PR also to check if all tests in CI pass.
Summary
sigs.k8s.io/controller-toolsfrom v0.21.0 to v0.20.1setup-envtestas it also requires apimachinery v0.36replacedirectives fromgo.modk8s.io/*packages to v0.35.5 directly inrequireMore infos
controller-tools v0.21.0 declares k8s.io/* v0.36.0 in its go.mod, which forces Go's MVS to resolve k8s.io/client-go to v0.36.0. This is incompatible with controller-runtime v0.23.3. The replace directives were a workaround to force v0.35.5.
Instead, downgrade controller-tools to v0.20.1 (which uses k8s.io v0.35.0) so MVS naturally resolves to v0.35.5. This eliminates the need for all 17 replace directives and fixes downstream consumers that don't inherit replace directives.
The setup-envtest required apimachinery 0.36.0 so I also downgraded it to the latest pseudo version that is compatible with 0.35.
Checklist