mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 15:28:35 +00:00
Documentation improvements and code cleanups for graph package
Expand the godoc documentation for the graph package. Centralize DefaultTag in the graphs/tag package instead of defining it twice. Remove some unnecessary "config" structs that are only used to pass a few parameters to a function. Simplify the GetParentsSize function - there's no reason for it to take an accumulator argument. Unexport some functions that aren't needed outside the package. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
+1
-1
@@ -526,7 +526,7 @@ func rewriteDockerfileFrom(dockerfileName string, translator func(string, regist
|
||||
// Replace the line with a resolved "FROM repo@digest"
|
||||
repo, tag := parsers.ParseRepositoryTag(matches[1])
|
||||
if tag == "" {
|
||||
tag = tags.DEFAULTTAG
|
||||
tag = tags.DefaultTag
|
||||
}
|
||||
ref := registry.ParseReference(tag)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ func (cli *DockerCli) pullImageCustomOut(image string, out io.Writer) error {
|
||||
repos, tag := parsers.ParseRepositoryTag(image)
|
||||
// pull only the image tagged 'latest' if no tag was specified
|
||||
if tag == "" {
|
||||
tag = tags.DEFAULTTAG
|
||||
tag = tags.DefaultTag
|
||||
}
|
||||
v.Set("fromImage", repos)
|
||||
v.Set("tag", tag)
|
||||
@@ -96,7 +96,7 @@ func (cli *DockerCli) createContainer(config *runconfig.Config, hostConfig *runc
|
||||
|
||||
repo, tag := parsers.ParseRepositoryTag(config.Image)
|
||||
if tag == "" {
|
||||
tag = tags.DEFAULTTAG
|
||||
tag = tags.DefaultTag
|
||||
}
|
||||
|
||||
ref := registry.ParseReference(tag)
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ func (cli *DockerCli) CmdPull(args ...string) error {
|
||||
|
||||
taglessRemote, tag := parsers.ParseRepositoryTag(remote)
|
||||
if tag == "" && !*allTags {
|
||||
tag = tags.DEFAULTTAG
|
||||
tag = tags.DefaultTag
|
||||
fmt.Fprintf(cli.out, "Using default tag: %s\n", tag)
|
||||
} else if tag != "" && *allTags {
|
||||
return fmt.Errorf("tag can't be used with --all-tags/-a")
|
||||
|
||||
Reference in New Issue
Block a user