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

Remove dependency on buildpack/imgutil #133

Merged
merged 3 commits into from
Sep 17, 2019
Merged

Remove dependency on buildpack/imgutil #133

merged 3 commits into from
Sep 17, 2019

Conversation

matthewmcnew
Copy link
Collaborator

@matthewmcnew matthewmcnew commented Sep 16, 2019

@cf-gitbot
Copy link

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.

Copy link

@thisisnotashwin thisisnotashwin left a 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.

"github.com/pkg/errors"
)

type GGCRImage struct {

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 🤷‍♂

repoName string
}

func NewGGCRImage(repoName string, keychain authn.Keychain) (*GGCRImage, error) {

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) {

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
Copy link

@thisisnotashwin thisisnotashwin left a 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,

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?

Copy link
Collaborator Author

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

@@ -2,27 +2,31 @@ package dockercreds

import (
"fmt"
"github.com/google/go-containerregistry/pkg/name"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import order nit

out.yaml Outdated
@@ -0,0 +1,217 @@
apiVersion: v1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked in by mistake?

Copy link
Collaborator Author

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 :)

Copy link
Contributor

@c-abramson c-abramson left a 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 {
Copy link
Contributor

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?

Copy link
Collaborator Author

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 {
Copy link
Contributor

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?

Copy link
Collaborator Author

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
@matthewmcnew matthewmcnew merged commit 85ef716 into master Sep 17, 2019
@thisisnotashwin thisisnotashwin deleted the remove-imgutil branch October 17, 2019 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Builder.Spec.Image does not support images with digest
4 participants