Skip to content

Fix dangling filter for images command#1201

Closed
TomSweeneyRedHat wants to merge 1 commit intocontainers:masterfrom
TomSweeneyRedHat:dev/tsweeney/dangle
Closed

Fix dangling filter for images command#1201
TomSweeneyRedHat wants to merge 1 commit intocontainers:masterfrom
TomSweeneyRedHat:dev/tsweeney/dangle

Conversation

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

Signed-off-by: TomSweeneyRedHat tsweeney@redhat.com

In version 1.4 of Buildah and earlier, the internal name for a dangling image was <none>. With changes that came in after 1.4, the internal name was changed to <none>:<none> and this caused the buildah images --filter dangling=true command to no longer work.

Rather than comparing strictly to <none>, this change does a strings.contains() for that. I've also added tests so if we fall off the rails again in the future, the test system will catch it.

Addresses: #1199
Tests:

# ctr=$(buildah from scratch)

# buildah commit $ctr test
{output removed for brevity}
Storing signatures
1ace9c1b7814267c30e6377b900dbfaacdba9aee6adb692f3d140e20d0e19d30

# buildah commit $ctr test
{output removed for brevity}
Storing signatures
2d9f02d2fb65ba3a9ca4e70ec158892183427aecfe30b8e9e15d8153d20222ba

# buildah images
IMAGE NAME                                               IMAGE TAG            IMAGE ID             CREATED AT             SIZE
<none>                                                   <none>               1ace9c1b7814         Nov 27, 2018 08:56     1.63 KB
localhost/test                                           latest               2d9f02d2fb65         Nov 27, 2018 08:56     1.63 KB

# buildah images --filter dangling=false
IMAGE NAME                                               IMAGE TAG            IMAGE ID             CREATED AT             SIZE
localhost/test                                           latest               2d9f02d2fb65         Nov 27, 2018 08:56     1.63 KB

# buildah images --filter dangling=true
IMAGE NAME                                               IMAGE TAG            IMAGE ID             CREATED AT             SIZE
<none>                                                   <none>               1ace9c1b7814         Nov 27, 2018 08:56     1.63 KB

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Nov 27, 2018

LGTM

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Nov 27, 2018

Looks like your tests are failing.

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

@rhatdan yeah, they passed locally in my sandbox, trying to figure out what's different in Travis CI.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Nov 27, 2018

bot, retest this please
@giuseppe @umohnani8 @vrothberg @pixdrift @nalind @boaz1337 PTAL

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

bot, retest this please.

@umohnani8
Copy link
Copy Markdown
Member

LGTM
Question: Would intermediate images that are built during a build process also be considered as dangling images? Intermediate images have <none> as their name.

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

I'm going to close and then reopen in hopes that will get Red Hat CI hip.

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

@rhatdan Red Hat CI keeps crashing without any bread crumbs. @jlebon do you know of anything going sideways there? It was working earlier today, I think before noon, but not since.

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Nov 28, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

📌 Commit aaac18e has been approved by rhatdan

@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

⌛ Testing commit aaac18e with merge 620fdee...

@rh-atomic-bot
Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-papr, status-travis
Approved by: rhatdan
Pushing 620fdee to master...

@TomSweeneyRedHat
Copy link
Copy Markdown
Member Author

@umohnani8 I believe the intermediate images that you're describing, if tagged as ":" are also considered to be dangling. But I'd take @nalind 's or @rhatdan 's word on that over mine.

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Nov 28, 2018

I would have to check if Docker considers them dangling. That would be the standard I guess.

umohnani8 pushed a commit to umohnani8/buildah that referenced this pull request Dec 6, 2018
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: containers#1201
Approved by: rhatdan
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants