-
Notifications
You must be signed in to change notification settings - Fork 54
fix(inspect): remove defaultDomain from pkg/reference #485
Conversation
Currently looking into a cleaner fix by refactoring pkg/reference, but this gets things working for the time being. |
I'm getting this error on install:
Am I doing something wrong to test? |
pkg/reference/normalize.go
Outdated
const ( | ||
// DefaultDomain is the default docker domain. | ||
// HACK(bacongobbler): set DefaultDomain to something arbitrary that will never be used, and strip it out after calling ParseNormalizedName. | ||
DefaultDomain = "i.hope.nobody.claims.this.domain" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
going back to the drawing board, so I'm marking this as WIP for the time being |
Docker's pkg/reference package relies on the assumption that reference.splitDockerDomain() returns the default domain when it's not present. This triggers a bug with `duffle inspect` and others where `duffle inspect helloworld` will search for a bundle called `hub.cnlabs.io/helloworld:latest`. This commit removes reference.ParseNormalizedReference from appending `defaultDomain` to the bundle name. Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
okay, I've removed the concept of a defaultDomain from pkg/reference and all seems to work again.
|
} else { | ||
domain, remainder = name[:i], name[i+1:] | ||
} | ||
return | ||
} | ||
|
||
// familiarizeName returns a shortened version of the name familiar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much red ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually tested, LGTM
Docker's pkg/reference package relies on the assumption that reference.splitDockerDomain() returns the default domain when it's not present. This triggers a bug with
duffle inspect
and others whereduffle inspect helloworld
will search for a bundle calledhub.cnlabs.io/helloworld:latest
. It uses hub.cnlabs.io instead of docker.io because we changed thedefaultDomain
field.This hack strips out the DefaultDomain from the image reference when searching for the bundle in repositories.json.
closes #337
Signed-off-by: Matthew Fisher matt.fisher@microsoft.com