reference: upstreams additions from forked docker/reference package#1277
reference: upstreams additions from forked docker/reference package#1277stevvooe wants to merge 2 commits into
Conversation
cad87a1 to
adbf469
Compare
|
Consider moving the "docker default" behavior into this package, as well. |
There was a problem hiding this comment.
I see what you're going for here but I don't think we should make this interface change yet, because it will make it impossible to vendor an updated distribution repository in the Docker Engine until all the reference changes are upstreamed. We will need to vendor an updated distribution repository soon to get the updated manifest code. So I would prefer to wait until the Engine is ported over to a unified reference package before adding a internal() method to this interface.
There was a problem hiding this comment.
I am sorry, but I want to force that requirement. I am not to thrilled about the forking of the reference package and have put in measures to ensure that doesn't happen again. This also let's us write helper functions with stronger guarantees.
There was a problem hiding this comment.
I understand that you want to force the requirement, but I think it needs to come after the package is unified. I don't want to merge something that will make it impossible to vendor an updated distribution package without further big changes, especially when I need to vendor an updated distribution package soon.
There was a problem hiding this comment.
Per our conversation, this has been removed.
adbf469 to
b27eda9
Compare
There was a problem hiding this comment.
Do you plan to address this before merging, or in a followup?
There was a problem hiding this comment.
This will come in a follow up.
I would prefer to add |
a78e63a to
637b365
Compare
|
There is a compile error in I think the changes to |
637b365 to
16657ab
Compare
|
@aaronlehmann Should be fixed now. |
There was a problem hiding this comment.
Could this function be preserved, perhaps under the name ParseNameOnly? It is used in several places in the engine.
There was a problem hiding this comment.
Is this not identical to ParseNamed?
It seems there are two paths here: one path uses ParseNamed + NamedOnly/IsNameOnly and the other uses this function (or what would be ParseNameOnly). Do we need to ensure that we only use the repository name or do need to ensure that the input is strictly the repository name?
There was a problem hiding this comment.
It's not identical to ParseNamed because this function won't accept tags or digests. There are some cases where an item being parsed is strictly a name only, and tags or digests shouldn't be accepted. It would be useful to keep this convenience function to support this case. It's fine with me if it's implemented as ParseNamed + NamedOnly.
There was a problem hiding this comment.
Ok, so I'll add something with the strict behavior.
Rather than fork, we have now upstreamed some of the additions required in moby/moby#18586. Of upmost importance is the addition of a useful WithName function. While did attempt to restrict Reference implementations to being from the reference package, making Reference a proper algebraic data type, we ran into issues with the usage in the main docker project. We will re-examine this approach in the future. This change will be followed up with some other additions from the daemon. Signed-off-by: Stephen J Day <stephen.day@docker.com>
16657ab to
6664e6d
Compare
|
LGTM - but please hold off on merging to avoid interfering with cross-repository push vendoring |
Signed-off-by: Stephen J Day <stephen.day@docker.com>
There was a problem hiding this comment.
It looks like this won't play nicely without backing types defined outside this package. This seems like an oversight, because the godoc comment says implies it works with other types.
There was a problem hiding this comment.
Was that not covered by the comment?
+// If the target of named is from another package, any data on the backing
+// type will be lost and replaced with an instance from this package. Simply
+// put, the resulting type will only include information available on the
+// interface.
There was a problem hiding this comment.
I may be misreading the code, but it looks like if you call it with a type that's not handled by the switch statement, it returns ErrNameDisallowed.
So the comment says the extra data from a foreign type will be lost, but in reality you just get an error.
There was a problem hiding this comment.
The cases for Canonical, Named and Tagged are handled. What else is missing?
There was a problem hiding this comment.
I don't see those. I only see concrete types being handled.
There was a problem hiding this comment.
Er, looking at the wrong one. Are you implying it should look like WithTag below?
There was a problem hiding this comment.
Yes, I think that would make sense.
|
What's the status on this one? |
|
@dmp42 We are still working towards a balance here. The engine PR will drive this one. |
|
Merged alternate with #1778 |
Signed-off-by: Stephen J Day stephen.day@docker.com