-
Notifications
You must be signed in to change notification settings - Fork 177
Add -q flag for image ls command #695
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import ( | |
"io" | ||
"regexp" | ||
|
||
"github.com/deislabs/cnab-go/bundle" | ||
"github.com/docker/distribution/reference" | ||
"github.com/opencontainers/go-digest" | ||
) | ||
|
@@ -27,6 +28,11 @@ func FromString(s string) (ID, error) { | |
return ID{s}, nil | ||
} | ||
|
||
func FromBundle(bndle *bundle.Bundle) (ID, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It’s an odd name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed. What about attaching a getID() function to Bundle ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wasn't the remark about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the package is not the right one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
digest, err := ComputeDigest(bndle) | ||
return ID{digest.Encoded()}, err | ||
} | ||
|
||
// ID is an unique identifier for docker app image bundle, implementing reference.Reference | ||
type ID struct { | ||
digest string | ||
|
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 think a unit test would be easier for this feature, mocking the bundle store to configure it the way you want.
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.
A unit test has been added