-
Notifications
You must be signed in to change notification settings - Fork 112
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
load configuration file with right ResourceLoader #701
load configuration file with right ResourceLoader #701
Conversation
7ba1cd6
to
95281eb
Compare
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.
LGTM, some minor comment
|
||
for i, p := range configFiles { | ||
for _, loader := range opts.ResourceLoaders { | ||
_, isLocalResourceLoader := loader.(localResourceLoader) |
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 local loader reject Accept
it's highly probable it will also fail on Load
, so why not just let it reject path and get this function return an error if no loader accepted the path ?
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.
Yes but you won't have the reason why.
What I could do is changing the Accept
signature to return an error in addition of the boolean, WDYT?
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.
the other option could be for localResource Loader
to always accept path. The Load
can return file not found error
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.
Ok I'll adapt the Accept
function of resource loader
aebbee9
to
b5c8e72
Compare
a41bb55
to
0f71bc7
Compare
Signed-off-by: Matthew Humphreys <[email protected]>
and pass workdir to LoadConfigFiles func to setup ConfigDetails Signed-off-by: Guillaume Lours <[email protected]>
0f71bc7
to
e16daf2
Compare
Detect and use the right ResourceLoader to load a config file and add it
ConfigDetails
struct.LocalResourceLoader
is always used as the last loader and should failed if it's not able to parse the configuration file.This PR replace #592