-
Notifications
You must be signed in to change notification settings - Fork 165
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
Remove dependency on buildpack/imgutil #133
Conversation
matthewmcnew
commented
Sep 16, 2019
•
edited
Loading
edited
- Create GGCRImage that implements RemoteImage interface
- Fixes Builder.Spec.Image does not support images with digest #128
- Upgrades lifecycle to 0.0.4
We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story. The labels on this github issue will be updated when the story is started. |
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.
Can we update some of the names. Overall love that we are moving away from using imgutil
. This should bring in flexibility in the future and also address the bug we have.
pkg/registry/ggcr_image.go
Outdated
"github.com/pkg/errors" | ||
) | ||
|
||
type GGCRImage struct { |
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.
Not sure if GGCR
is how the community refers to the library. We could call it RegistryImage
possibly? That or even RemoteImage
🤷♂
pkg/registry/ggcr_image.go
Outdated
repoName string | ||
} | ||
|
||
func NewGGCRImage(repoName string, keychain authn.Keychain) (*GGCRImage, error) { |
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.
Do we want to call it GetRemoteImage
or something similar, because we do not want to create an image in case one doesn't exist right? We only want to fetch an already existing one.
"github.com/google/go-containerregistry/pkg/authn" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
type ImageFactory struct { | ||
KeychainFactory KeychainFactory | ||
} | ||
|
||
func (f *ImageFactory) NewRemote(imageRef ImageRef) (RemoteImage, error) { |
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.
As an extension of our previous comment, can we update this as well to say Get/FetchRemote
because it will never be our intent on actually creating a new remote image
- Create GGCRImage that implements RemoteImage interface - Fixes #128
d25bfe9
to
6115a29
Compare
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.
LGTM
- Use 'io.buildpacks.build.metadata' to fetch built image metadata - Bump Go Container Registry
@@ -57,23 +57,23 @@ func (r *RemoteMetadataRetriever) GetBuilderImage(repo registry.ImageRef) (Build | |||
|
|||
return BuilderImage{ | |||
BuilderBuildpackMetadata: metadata.Buildpacks, | |||
Identifier: identifier.String(), | |||
Identifier: identifier, |
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.
should this be Image too?
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.
That is an actual built image identifier. Not the same thing as an image because it always includes the digest
pkg/dockercreds/access_checker.go
Outdated
@@ -2,27 +2,31 @@ package dockercreds | |||
|
|||
import ( | |||
"fmt" | |||
"github.com/google/go-containerregistry/pkg/name" |
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.
import order nit
619d075
to
42d5238
Compare
out.yaml
Outdated
@@ -0,0 +1,217 @@ | |||
apiVersion: v1 |
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.
Checked in by mistake?
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.
I finally accidentally did. Gone now :)
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.
looking nice, left some comments
@@ -60,21 +64,3 @@ func HasWriteAccess(tagName string) (bool, error) { | |||
|
|||
return true, nil | |||
} | |||
|
|||
type unAuthorizedWithoutErrorCodeTransportChecker struct { |
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.
does the new version of ggcr make this obsolete?
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.
Sort of. We can get the status code now directly on the transport error.
"github.com/pkg/errors" | ||
) | ||
|
||
type GoContainerRegistryImage struct { |
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.
can we rename this file/struct ... maybe RemoteRegistryImage?
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.
My thought is the consumers of this object will consume it through the RemoteImage interface. What makes this struct unique is that it implements that interface using GoContainerRegistry library.
- Prevents confusing Identifier object on builder/build types
42d5238
to
3ee8d25
Compare