-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Canonicalize provider version during default provider lookup #16109
Conversation
Changelog[uncommitted] (2024-05-03)Bug Fixes
|
pkg/resource/deploy/source_eval.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored the "normalization" logic out of newRegisterDefaultProviderEvent
into a normalizeProviderRequest
function, so that it could be executed before the provider cache is checked.
Note that the logic will execute more often, i.e. for cache hits and for misses, and so I simplified the logging a little bit.
Description
This PR addresses a problem that leads to two default providers for a given package+version. The problem occurs when given a combination of unversioned and versioned provider requests, as can occur in multi-language programs.
The fix is as follows: given an unversioned provider request, apply the default version before looking into the provider cache.
More background: #2767
Fixes #16108
Example
Given the example program from #16108 plus this fix, the stack state has one provider as expected:
Checklist
make tidy
to update any new dependenciesmake lint
to verify my code passes the lint checkgofumpt
make changelog
and committed thechangelog/pending/<file>
documenting my change