Deprecate --graph flag; Replace with --data-root#28696
Deprecate --graph flag; Replace with --data-root#28696vdemeester merged 2 commits intomoby:masterfrom
Conversation
|
As the guy who first used the term "graph" in this context (because of the git-like graph relationship between layers), I agree that it's confusing and should be deprecated. As long as this introduces absolutely no interface regression, I am in favor. |
44ed340 to
db2f932
Compare
docs/deprecated.md
Outdated
There was a problem hiding this comment.
hyperlink wrong: v1.11.0->v1.14.0
There was a problem hiding this comment.
Is it okay to set it to a non-existing link?
There was a problem hiding this comment.
I'll just remove the link for now.
db2f932 to
6f6b107
Compare
|
According to the docs include in this PR, the milestone of this PR seems 1.14. However, in 1.13, GraphDriver plugin will be moved to out of experimental. I'm +1 for renaming GraphDriver, but I don't think we should call it "DataRootDriver"... PTAL @cpuguy83 |
Oh, I've been wanting to do that for about 2 years: #9758 but we never got around to doing it. There is also already an existing
I think these are two distinct things: |
|
@AkihiroSuda @jlhawn it was attempted twice; #22228 and #23237, but there were issues on Windows. Maybe they are resolved in the newer Windows versions. |
contrib/completion/bash/docker
Outdated
There was a problem hiding this comment.
Please add -d as a third choice here .
There was a problem hiding this comment.
Hm, would -d become confusing with -D? Otherwise I suggest to skip adding a shorthand flag
There was a problem hiding this comment.
That sounds reasonable. There's also not a shorthand for the --exec-root option. Let me know when the maintainers have a consensus on what to do here and I'll update if needed.
There was a problem hiding this comment.
Probably best to remove it initially, it's easier to add later than to deprecate / remove
There was a problem hiding this comment.
Okay, removed for now. I'll add it back if needed.
ba528be to
5120b0a
Compare
|
SGTM |
|
Ok for me, but I don't think we could ever actually remove |
5120b0a to
490e870
Compare
|
@jlhawn can you keep the old flags around as a hidden flag, in addition to the current one? Also, the |
Is this not already covered by this: https://github.com/docker/docker/pull/28696/files#diff-a348195a1b645d5b477946b1efae728bR173 ? Also the |
|
ping @thaJeztah |
|
@jlhawn sorry, yes, you're right about the hidden flag. w.r.t. removing the flag, given that this flag has been around since docker < 1.0, we may need to decide to keep it around, and not actually remove it, but open to suggestions there. There's a think that needs to be addressed in this PR; you forgot to update the name in the To allow both the old and the new name to work; possibly we need to have an additional property, that's mapped to the old ( In addition; the deprecation warning is currently printed on the commandline. Given that daemon options would usually be set in either a systemd unit file, or through |
|
@thaJeztah I can't quite wrap my head around the code which handles the config file and command line arguments (theres a bunch of stuff which handles resolving conflicts and setting defaults when both are used). Is there an existing example of how to deprecate something from the config file? The only other daemon flag I see which is marked as deprecated is the
The flag library being used will print the deprecation warning to |
|
The more I look at it, the more it looks like I might have to "invent" a way of marking and handling deprecated config file options. |
|
Yes, I think this is a first for config-file deprecation. It will probably mean something like; type CommonConfig struct {
RootDeprecated string `json:"graph,omitempty"`
Root string `json:"data-dir,omitempty"`
}
w.r.t. both "flag" and "config file"; the current behavior is that if both a flag and the same option in the config file are set, that an error is shown. |
vdemeester
left a comment
There was a problem hiding this comment.
LGTM with I'll add it as a warning to the logs as well. from @thaJeztah 👼
dc88a83 to
4df689c
Compare
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
4df689c to
df7a72c
Compare
|
ok, updated after discussing with @vdemeester, and changed to hide the flag instead of printing a deprecation warning, and only log the warning. I think this is the least disruptive approach, and still discourages using the old flag, but happy to change back if we think otherwise |
|
ok, discussed in the maintainers meeting, and there were no objections to this approach, so should be ready to go 😄 |
|
Ok then, let's be crazy and merge it 👼 |
|
Thanks @jlhawn ! |
|
Although deprecated - is this a breaking change? There are lots of tutorials etc on the internet that advise on using -g to specify a different path/disk for the Docker data area. |
|
@alexellis the flags are hidden not removed. It won't break anyone.
|
This patch deprecates the
-gor--graphflag on thedockerdordocker daemoncommand in favor of the more descriptive--data-rootflag.The name "graph" is a legacy term from long ago when there used to be a directory at the default location
/var/lib/docker/graph. However, the flag would indicate the path of the parent directory of the "graph" directory which contains not only image data but also data for volumes, containers, and networks. In the most recent version of docker, this directory also contains swarm cluster state and node certificates.Documentation for the
--graphoption has been updated to use the--data-rootflag instead. A deprecation notice has also been added.