Skip to content

Commit

Permalink
Merge pull request #17 from ImJasonH/weak
Browse files Browse the repository at this point in the history
Drop name.WeakValidation
  • Loading branch information
jonjohnsonjr authored Mar 22, 2019
2 parents f0a367d + 86a2d43 commit eab537e
Show file tree
Hide file tree
Showing 16 changed files with 88 additions and 48 deletions.
4 changes: 2 additions & 2 deletions Gopkg.lock

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

4 changes: 2 additions & 2 deletions pkg/publish/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (d *demon) Publish(img v1.Image, s string) (name.Reference, error) {
return nil, err
}

digestTag, err := name.NewTag(fmt.Sprintf("%s/%s:%s", LocalDomain, d.namer(s), h.Hex), name.WeakValidation)
digestTag, err := name.NewTag(fmt.Sprintf("%s/%s:%s", LocalDomain, d.namer(s), h.Hex))
if err != nil {
return nil, err
}
Expand All @@ -63,7 +63,7 @@ func (d *demon) Publish(img v1.Image, s string) (name.Reference, error) {

for _, tagName := range d.tags {
log.Printf("Adding tag %v", tagName)
tag, err := name.NewTag(fmt.Sprintf("%s/%s:%s", LocalDomain, d.namer(s), tagName), name.WeakValidation)
tag, err := name.NewTag(fmt.Sprintf("%s/%s:%s", LocalDomain, d.namer(s), tagName))
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/publish/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (d *defalt) Publish(img v1.Image, s string) (name.Reference, error) {
s = strings.ToLower(s)

for _, tagName := range d.tags {
tag, err := name.NewTag(fmt.Sprintf("%s/%s:%s", d.base, d.namer(s), tagName), name.WeakValidation)
tag, err := name.NewTag(fmt.Sprintf("%s/%s:%s", d.base, d.namer(s), tagName))
if err != nil {
return nil, err
}
Expand All @@ -112,7 +112,7 @@ func (d *defalt) Publish(img v1.Image, s string) (name.Reference, error) {
if err != nil {
return nil, err
}
dig, err := name.NewDigest(fmt.Sprintf("%s/%s@%s", d.base, d.namer(s), h), name.WeakValidation)
dig, err := name.NewDigest(fmt.Sprintf("%s/%s@%s", d.base, d.namer(s), h))
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/publish/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestDefault(t *testing.T) {
if err != nil {
t.Fatalf("url.Parse(%v) = %v", server.URL, err)
}
tag, err := name.NewTag(fmt.Sprintf("%s/%s:latest", u.Host, expectedRepo), name.WeakValidation)
tag, err := name.NewTag(fmt.Sprintf("%s/%s:latest", u.Host, expectedRepo))
if err != nil {
t.Fatalf("NewTag() = %v", err)
}
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestDefaultWithCustomNamer(t *testing.T) {
if err != nil {
t.Fatalf("url.Parse(%v) = %v", server.URL, err)
}
tag, err := name.NewTag(fmt.Sprintf("%s/%s:latest", u.Host, expectedRepo), name.WeakValidation)
tag, err := name.NewTag(fmt.Sprintf("%s/%s:latest", u.Host, expectedRepo))
if err != nil {
t.Fatalf("NewTag() = %v", err)
}
Expand Down Expand Up @@ -194,7 +194,7 @@ func TestDefaultWithTags(t *testing.T) {
if err != nil {
t.Fatalf("url.Parse(%v) = %v", server.URL, err)
}
tag, err := name.NewTag(fmt.Sprintf("%s/%s:notLatest", u.Host, expectedRepo), name.WeakValidation)
tag, err := name.NewTag(fmt.Sprintf("%s/%s:notLatest", u.Host, expectedRepo))
if err != nil {
t.Fatalf("NewTag() = %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/publish/future_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func makeRef() (name.Reference, error) {
if err != nil {
return nil, err
}
return name.NewDigest(fmt.Sprintf("gcr.io/foo/bar@%s", d), name.WeakValidation)
return name.NewDigest(fmt.Sprintf("gcr.io/foo/bar@%s", d))
}

func TestSameFutureSameReference(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/publish/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func WithAuthFromKeychain(keys authn.Keychain) Option {
// means that docker.io/mattmoor actually gets interpreted as
// docker.io/library/mattmoor, which gets tricky when we start
// appending things to it in the publisher.
repo, err := name.NewRepository(i.base, name.WeakValidation)
repo, err := name.NewRepository(i.base)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/resolve/fixed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

var (
fixedBaseRepo, _ = name.NewRepository("gcr.io/asdf", name.WeakValidation)
fixedBaseRepo, _ = name.NewRepository("gcr.io/asdf")
testImage, _ = random.Image(1024, 5)
)

Expand Down Expand Up @@ -129,7 +129,7 @@ func (f *fixedPublish) Publish(_ v1.Image, s string) (name.Reference, error) {
if !ok {
return nil, fmt.Errorf("unsupported importpath: %q", s)
}
d, err := name.NewDigest(fmt.Sprintf("%s/%s@%s", f.base, s, h), name.WeakValidation)
d, err := name.NewDigest(fmt.Sprintf("%s/%s@%s", f.base, s, h))
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resolve/resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func mustRandom() v1.Image {
}

func mustRepository(s string) name.Repository {
n, err := name.NewRepository(s, name.WeakValidation)
n, err := name.NewRepository(s)
if err != nil {
panic(err)
}
Expand Down

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

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

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

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

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

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

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

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

0 comments on commit eab537e

Please sign in to comment.