From aef37bfcef5ab980ee25e63602e22d67f6ef5a42 Mon Sep 17 00:00:00 2001 From: Ivan Ilves Date: Sat, 30 Sep 2017 21:59:28 +0200 Subject: [PATCH] Renamed `--pull-images` to `--pull` :pig: --- README.md | 4 ++-- main.go | 6 +++--- tag/local/local.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0a8add0..6b97d50 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,11 @@ You could use `lstags`, if you ... ## How do I use it myself? I run `lstags` inside a Cron Job on my Kubernetes worker nodes to poll my own Docker registry for a new [stable] images. ``` -lstags --pull-images -u myuser -p mypass registry.ivanilves.local/tools/sicario~/v1\\.[0-9]+$/ +lstags --pull -u myuser -p mypass registry.ivanilves.local/tools/sicario~/v1\\.[0-9]+$/ ``` ... and following cronjob runs on my CI server to ensure I always have latest Ubuntu 14.04 and 16.04 images to play with: ``` -lstags --pull-images ubuntu~/^1[46]\\.04$/" +lstags --pull ubuntu~/^1[46]\\.04$/" ``` My CI server is connected over crappy Internet link and pulling images in advance makes `docker run` much faster. :wink: diff --git a/main.go b/main.go index c1531e4..61f08c8 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,7 @@ type options struct { Password string `short:"p" long:"password" default:"" description:"Docker registry password" env:"PASSWORD"` DockerJSON string `shord:"j" long:"docker-json" default:"~/.docker/config.json" env:"DOCKER_JSON"` Concurrency int `short:"c" long:"concurrency" default:"32" description:"Concurrent request limit while querying registry" env:"CONCURRENCY"` - PullImages bool `short:"P" long:"pull-images" description:"Pull images matched by filter" env:"PULL_IMAGES"` + Pull bool `short:"P" long:"pull" description:"Pull images matched by filter" env:"PULL"` InsecureRegistry bool `short:"i" long:"insecure-registry" description:"Use insecure plain-HTTP registriy" env:"INSECURE_REGISTRY"` TraceRequests bool `short:"T" long:"trace-requests" description:"Trace registry HTTP requests" env:"TRACE_REQUESTS"` Version bool `short:"V" long:"version" description:"Show version and exit"` @@ -212,13 +212,13 @@ func main() { } - if o.PullImages { + if o.Pull { for i, tg := range allTags { if tg.NeedsPull() { ref := lsRepos[i] + ":" + tg.GetName() fmt.Printf("PULLING: %s\n", ref) - err := local.PullImage(ref) + err := local.Pull(ref) if err != nil { suicide(err) } diff --git a/tag/local/local.go b/tag/local/local.go index ad85fd5..7a5eb7e 100644 --- a/tag/local/local.go +++ b/tag/local/local.go @@ -168,8 +168,8 @@ func FormatRepoName(repository, registry string) string { return registry + "/" + repository } -// PullImage pulls Docker image specified locally -func PullImage(ref string) error { +// Pull pulls Docker image specified locally +func Pull(ref string) error { cli, err := newClient() if err != nil { return err