Comments (4)
@ekcasey I tried to replicate this using the test:
when("image exists and as no labels", func() {
var (
img imgutil.Image
origID string
)
it.Before(func() {
var err error
h.CreateImageOnLocal(t, dockerClient, repoName, fmt.Sprintf(`
FROM scratch
LABEL repo_name_for_randomisation=%s
`, repoName), nil)
img, err = imgutil.NewLocalImage(repoName, dockerClient)
h.AssertNil(t, err)
origID = h.ImageID(t, repoName)
})
it.After(func() {
h.AssertNil(t, h.DockerRmi(dockerClient, repoName, origID))
})
it("sets label and saves label to docker daemon", func() {
h.AssertNil(t, img.SetLabel("somekey", "new-val"))
t.Log("set label")
label, err := img.Label("somekey")
h.AssertNil(t, err)
h.AssertEq(t, label, "new-val")
t.Log("save label")
_, err = img.Save()
h.AssertNil(t, err)
inspect, _, err := dockerClient.ImageInspectWithRaw(context.TODO(), repoName)
h.AssertNil(t, err)
label = inspect.Config.Labels["somekey"]
h.AssertEq(t, strings.TrimSpace(label), "new-val")
})
})
and it did not panic, do you think this issue is solved already?
from imgutil.
@joaopapereira It looks like there is a label on that test image?
from imgutil.
These tests pass
when.Focus("image exists without labels", func() {
it.Before(func() {
h.CreateImageOnRemote(t, dockerClient, repoName, fmt.Sprintf(`
FROM scratch
CMD ["/bin/sh"]
`), nil)
var err error
img, err = imgutil.NewRemoteImage(repoName, authn.DefaultKeychain)
h.AssertNil(t, err)
})
it("sets label on img object", func() {
h.AssertNil(t, img.SetLabel("mykey", "new-val"))
label, err := img.Label("mykey")
h.AssertNil(t, err)
h.AssertEq(t, label, "new-val")
})
it("saves label", func() {
h.AssertNil(t, img.SetLabel("mykey", "new-val"))
_, err := img.Save()
h.AssertNil(t, err)
// After Pull
label := remoteLabel(t, dockerClient, repoName, "mykey")
h.AssertEq(t, "new-val", label)
})
})
from imgutil.
@joaopapereira I think it only panics when it is a local image
from imgutil.
Related Issues (20)
- Support Saving images as archives.
- Should we limit the number of bytes in an image?
- Continue with test cleanup if previous cleanup fails
- Create an archive package in imgutil that exposes the ReadXAsTar functions
- fakes package should expose a way to create a non-existent image HOT 3
- Implement cnb.Image interface using OCI layout format
- Expose a method to parse an image reference into a local path
- Implement the SaveFile() method in the layout image interface
- Add annotation `org.opencontainers.image.ref.name` when image in OCI layout is saved
- Add annotation org.opencontainers.image.ref.name when Remote image is saved
- Expose a method to parse an image layout identifier
- Create an new interface to handle Manifest Lists
- imgutil images should be v1.Images HOT 3
- Fix performance penalty incurred by sending legacy formatted tars to the daemon
- Revert docker version upgrade HOT 1
- Add codecov support HOT 1
- Update GitHub Actions workflows to use environment files
- Fallback to slow behavior if writing to daemon fails with performance optimization
- local.Rebase/ReuseLayer leak temp files HOT 2
- Add ability to override v1Config() function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgutil.