-
Notifications
You must be signed in to change notification settings - Fork 8
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: fall back to global secrets was not working #1340
Conversation
|
||
func (p *InMemoryProvider[R]) Load(ctx context.Context, ref Ref, key *url.URL) ([]byte, error) { | ||
if bytes, found := p.values[ref]; found { | ||
return bytes, nil | ||
} | ||
return nil, fmt.Errorf("key %q not found", ref.Name) | ||
return nil, ErrNotFound |
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.
This specific error must be used
gref := ref | ||
gref.Module = optional.None[string]() | ||
key, err = m.resolver.Get(ctx, gref) | ||
ref.Module = optional.None[string]() |
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.
If global config/secret is found, we need the ref
var to point to it as it is used to access it from the provider.
Previously, resolver would match the global ref, but we would then use the module specific ref with the provider.
@@ -18,13 +18,13 @@ func NewInMemoryProvider[R Role]() *InMemoryProvider[R] { | |||
} | |||
|
|||
func (p *InMemoryProvider[R]) Role() R { var r R; return r } | |||
func (p *InMemoryProvider[R]) Key() string { return "grpc" } | |||
func (p *InMemoryProvider[R]) Key() string { return "inmemory" } |
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.
clean up for an old refactor
9b521f2
to
4299e91
Compare
Thanks for the comments! Very helpful in understanding the changes :) |
fixes #1339