use docker/reference.Store to manage tags/digest by app image ID #782
Conversation
64651c3
to
dc3e08d
Compare
Codecov Report
@@ Coverage Diff @@
## master #782 +/- ##
==========================================
- Coverage 70.43% 70.13% -0.31%
==========================================
Files 67 67
Lines 3734 3676 -58
==========================================
- Hits 2630 2578 -52
+ Misses 756 753 -3
+ Partials 348 345 -3
Continue to review full report at Codecov.
|
LGTM |
internal/store/digest.go
Outdated
} | ||
digest := digest.NewDigestFromEncoded(digest.SHA256, s) | ||
return ID{digest}, nil | ||
return ID(digest), nil |
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.
Maybe you can juste return here the result of fromID
?
func FromString(s string) (ID, error) {
if ok := identifierRegexp.MatchString(s); !ok {
return "", fmt.Errorf("could not parse %q as a valid reference", s)
}
return fromID(s), nil
if err := os.RemoveAll(path); err != nil { | ||
return nil | ||
defer f.Close() | ||
ids, err := f.Readdirnames(-1) |
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 this return directories like .
or ..
?
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.
only actual directories
} | ||
_, err = b.store.Delete(named) | ||
references := b.store.References(id) | ||
if len(references) > 0 { |
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.
What if len(references) == 0
, we discard the 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.
this just mean we don't have tags for this, only a Digest
func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) { | ||
cmd.Command = dockerCli.Command("app", "build", "-t", ref, path) | ||
func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) string { | ||
iidfile := fs.NewFile(t, "iid") |
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.
Why don't you use docker app build --quiet
instead?
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.
works as well, but I prefer iidfile :P
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.
Looks Cool To Me !!!!
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!
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
- What I did
Used docker/reference to implement imageStore
- How I did it
only store images by ID, use docker/reference to track tags/digest
- How to verify it
e2e test suite cover most usages
- Description for the changelog
re-implemented bundle store
- A picture of a cute animal (not mandatory)