Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop name.WeakValidation #17

Merged
merged 1 commit into from
Mar 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.