Deprecate -f flag from docker tag#18350
Conversation
|
I like consistency. Design LGTM. |
Closes moby#9798 @maintainers please note that this is a change to the UX. We no longer require the -f flag on `docker tag` to move a tag from an existing image. However, this does make us more consistent across our commands, see moby#9798 for the history. Signed-off-by: Doug Davis <dug@us.ibm.com>
|
Yup, I like consistency as well, design LGTM also /cc @tianon, who opened the issue that this resolves ❤️ |
|
Is there still a way not to move the tag of an image if the tag exists? |
|
@schmunk42 no, if we do this then we'll move it every time. Can you explain your scenario a bit? It sounds like you count on getting an error as part of your normal work flow - is that true? What do you do when you get the error to recover - just generate a new tag and try again? |
|
LGTM+++ |
|
@schmunk42 Have you consider changing it so that you use |
|
@duglin Our workflow in some projects is to tag docker images on a release branch from a version-file. Now, if someone accidentally pushes another commit with the same version on the release branch ... nothing happens, simply because the tag is already there. I have something like this in our CI scripts: btw: About consistency, I had opened a ticket to introduce I don't really rely on the error, but I also like to be asked, before I change crucial things. What's about tagging an image during local development, then later I move the tag accidentally - how do I get back the original version? |
|
LGTM |
Deprecate -f flag from docker tag
|
The Seeing that this flag will be removed in 1.12 makes me very sad since we will have to revert this change across all our repositories... I am OK with deprecation for consistency, but can't the actual removal happen in a major release (2.x)? |
|
@bjaglin it will be removed in docker-1.12 so ppl should have time to update their stuff. For now you just get a warning |
|
We also use I understand why I guess that also brings me to my question... What can we consider covered by a semver contract in docker if existing client features keep being broken in minor releases? A few examples of breaking changes in the client that have occurred would be when |
|
Given we haven't moved from "1.x" ever I don't think waiting for a major release version is much of an option. The best Docker has is the "give 'em 2 release warning": https://github.com/docker/docker/blob/master/docs/misc/index.md#feature-deprecation-policy |
|
Yeah, the flag isn't _gone_ yet (your scripts should still work as-is),
it's just turned into a warning now (and doesn't have any effect).
|
|
docs team please be more specific about the deprecation, right now when you use Ok, let's take a look on usage https://docs.docker.com/engine/reference/commandline/tag/, what it says about So what is current behavior is? Does it force or not? Do I need to manually delete tag before using it? The only one way to find out is to actually find this deprecation commit. It is always good to tell users, who used this before - what is the "migration" plan is. |
|
@outcoldman the deprecation is explained here; https://docs.docker.com/engine/deprecated/. The reason the flag is no longer mentioned on https://docs.docker.com/engine/reference/commandline/tag/ is because it's been deprecated; see this PR, which removes it from the docs |
|
@thaJeztah great, but how I can get to this page? I'm not trying to argue about this deprecation, I am trying to point on the luck of documentation in |
|
@outcoldman that message is automatically generated for flags that are marked deprecated; usually, a flag is deprecated in favor of another flag, and is a bit more informative; If you're have a suggestion on how to improve that message, feel free to add. |
|
@thaJeztah for example standard library always require you to specify a deprecation message, see https://godoc.org/github.com/spf13/pflag#FlagSet.MarkDeprecated (and https://github.com/spf13/pflag/blob/master/flag.go#L311) not something auto-generated, but informative for user. This is just a suggestion. |
|
That's not the standards library; the standards library (https://golang.org/pkg/flag/) doesn't have a way to deprecate flags, hence the (slightly hacky) mflags package was created. I agree that a custom deprecation message could be nice, possibly replacing mflags with pflags could be an option, however, with the deprecation page, and a mention in the change logs, it's not our top priority; PRs welcome though |
|
IMO it'd definitely be neat to adjust our flags package to allow for the deprecation message to be generally customized so we could add a link to our deprecation page 😇 |
The `-f` (force) flag was deprecated in Docker v1.10: - https://github.com/docker/docker/releases/tag/v1.10.0 - moby/moby#18350
Page 130, the docker flag {{-f}}} has been deprecated from {{docker tag}} and will throw Jenkins error {{unknown shorthand flag: 'f' in -f}} without removing the flag: moby/moby#18350
Closes #9798
@maintainers please note that this is a change to the UX. We no longer
require the -f flag on
docker tagto move a tag name from an existing image.However, this does make us more consistent across our commands,
see #9798 for the history.
Signed-off-by: Doug Davis dug@us.ibm.com