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 the dangling=true filter #457

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/kamal/cli/prune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def all
end
end

desc "images", "Prune dangling images"
desc "images", "Prune unused images"
def images
mutating do
on(KAMAL.hosts) do
Expand Down
2 changes: 1 addition & 1 deletion lib/kamal/commands/prune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Kamal::Commands::Prune < Kamal::Commands::Base
def dangling_images
docker :image, :prune, "--force", "--filter", "label=service=#{config.service}", "--filter", "dangling=true"
docker :image, :prune, "--force", "--filter", "label=service=#{config.service}"
end

def tagged_images
Expand Down
2 changes: 1 addition & 1 deletion test/cli/prune_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CliPruneTest < CliTestCase

test "images" do
run_command("images").tap do |output|
assert_match "docker image prune --force --filter label=service=app --filter dangling=true on 1.1.1.", output
assert_match "docker image prune --force --filter label=service=app on 1.1.1.", output
assert_match "docker image ls --filter label=service=app --format '{{.ID}} {{.Repository}}:{{.Tag}}' | grep -v -w \"$(docker container ls -a --format '{{.Image}}\\|' --filter label=service=app | tr -d '\\n')dhh/app:latest\\|dhh/app:<none>\" | while read image tag; do docker rmi $tag; done on 1.1.1.", output
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/commands/prune_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CommandsPruneTest < ActiveSupport::TestCase

test "dangling images" do
assert_equal \
"docker image prune --force --filter label=service=app --filter dangling=true",
"docker image prune --force --filter label=service=app",
new_command.dangling_images.join(" ")
end

Expand Down
Loading