You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The checksum passthrough behaviour is a bit strange (it makes the resolver a no-op) but I think it's useful for throwing user input at the function and knowing that what you get back is a commit ID that will work. I don't want to remove the ability to pass a checksum instead of a ref to the function, but maybe we can verify that the checksum ID exists in the repo at the URL.
The URL == "" behaviour even stranger. What's the point of calling a resolver when there's nothing to resolve? I think this is left over from older behaviour which was also doing things with the parent ref and shuffling things around. I think it would make more sense if URL == "" was an error condition.
The interaction with the ResolveRef() function in the same file is a bit bizarre. The ResolveRef() function is never called from anywhere else, not even osbuild-composer, and yet we have two arguments that are always nil. ResolveRef() is the function that's actually doing the resolving (of the ref), whereas Resolve() is meant to resolve arguments, figure out if a call to the URL is needed etc. Perhaps they should be merged, making ostree.Resolve() the only entrypoint into the resolver and putting some work onto the caller (like not bothering with the function call when the URL is empty and no resolve is desired).
The text was updated successfully, but these errors were encountered:
images/pkg/ostree/ostree.go
Lines 218 to 259 in 711ff22
While writing the otk container resolver and discussing certain details around testing with @mvo5, I realised that I'm not really happy with some of the behaviour of this function.
Some things to reconsider:
URL == ""
behaviour even stranger. What's the point of calling a resolver when there's nothing to resolve? I think this is left over from older behaviour which was also doing things with the parent ref and shuffling things around. I think it would make more sense ifURL == ""
was an error condition.ResolveRef()
function in the same file is a bit bizarre. TheResolveRef()
function is never called from anywhere else, not even osbuild-composer, and yet we have two arguments that are alwaysnil
.ResolveRef()
is the function that's actually doing the resolving (of the ref), whereasResolve()
is meant to resolve arguments, figure out if a call to the URL is needed etc. Perhaps they should be merged, makingostree.Resolve()
the only entrypoint into the resolver and putting some work onto the caller (like not bothering with the function call when the URL is empty and no resolve is desired).The text was updated successfully, but these errors were encountered: