Skip to content

Commit

Permalink
Refactor: Provide repository package
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanilves committed Feb 7, 2018
1 parent ceed3e4 commit c786bed
Show file tree
Hide file tree
Showing 13 changed files with 386 additions and 530 deletions.
20 changes: 19 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -77,7 +77,7 @@ shell-test-push-local-assumed-tags:
@echo "NB! Following command SHOULD fail, because no tags should be loaded without 'assumption'!"
./lstags localhost:${REGISTRY_PORT}/qa/calico/cni | egrep "v1\.(6\.1|7\.0)" && exit 1 || true
@echo "NB! Following command is assuming tags 'v1.6.1' and 'v1.7.0' do exist and will be loaded anyway."
./lstags --push-registry=localhost:${REGISTRY_PORT} --push-prefix=/qa quay.io/calico/cni~/^v1\\.[67]/=v1.6.1,v1.7.0
./lstags --push-registry=localhost:${REGISTRY_PORT} --push-prefix=/qa quay.io/calico/cni=v1.6.1,v1.7.0
@echo "NB! This should NOT fail, because above we assumed tags 'v1.6.1' and 'v1.7.0' do exist."
./lstags localhost:${REGISTRY_PORT}/qa/calico/cni | egrep "v1\.(6\.1|7\.0)"

Expand Down
6 changes: 3 additions & 3 deletions docker/client/client.go
Expand Up @@ -13,8 +13,8 @@ import (

"golang.org/x/net/context"

"github.com/ivanilves/lstags/docker"
"github.com/ivanilves/lstags/docker/config"
"github.com/ivanilves/lstags/repository"
)

// DockerSocket is a socket we use to connect to the Docker daemon
Expand Down Expand Up @@ -76,7 +76,7 @@ func buildImageListOptions(repo string) (types.ImageListOptions, error) {
// Pull pulls Docker image specified
func (dc *DockerClient) Pull(ref string) error {
registryAuth := dc.cnf.GetRegistryAuth(
docker.GetRegistry(ref),
repository.GetRegistry(ref),
)

pullOptions := types.ImagePullOptions{RegistryAuth: registryAuth}
Expand Down Expand Up @@ -117,7 +117,7 @@ func (dc *DockerClient) Pull(ref string) error {
// Push pushes Docker image specified
func (dc *DockerClient) Push(ref string) error {
registryAuth := dc.cnf.GetRegistryAuth(
docker.GetRegistry(ref),
repository.GetRegistry(ref),
)

pushOptions := types.ImagePushOptions{RegistryAuth: registryAuth}
Expand Down
80 changes: 0 additions & 80 deletions docker/docker.go

This file was deleted.

148 changes: 0 additions & 148 deletions docker/docker_test.go

This file was deleted.

0 comments on commit c786bed

Please sign in to comment.