Skip to content

Commit

Permalink
Renamed --pull-images to --pull 🐷
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanilves committed Sep 30, 2017
1 parent 3cf3ff9 commit aef37bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions tag/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aef37bf

Please sign in to comment.