Skip to content

registry/storage: add option to quiet GC output.#4560

Merged
milosgajdos merged 2 commits intodistribution:mainfrom
r4f4:garbage-collect-quiet
Feb 13, 2025
Merged

registry/storage: add option to quiet GC output.#4560
milosgajdos merged 2 commits intodistribution:mainfrom
r4f4:garbage-collect-quiet

Conversation

@r4f4
Copy link
Copy Markdown
Contributor

@r4f4 r4f4 commented Jan 31, 2025

Consumers might not want GC output to be displayed (e.g, if you have your own logging system).

Copy link
Copy Markdown
Member

@milosgajdos milosgajdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incomplete. You need to pass the Quiet setting to GC somehow:
likely through

var GCCmd = &cobra.Command{

Consumers might not want GC output to be displayed (e.g, if you have
your own logging system).

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
@r4f4 r4f4 force-pushed the garbage-collect-quiet branch from 5c98929 to a032989 Compare February 2, 2025 09:19
@r4f4
Copy link
Copy Markdown
Contributor Author

r4f4 commented Feb 2, 2025

Done:

 $ ./bin/registry garbage-collect --help
`garbage-collect` deletes layers not referenced by any manifests

Usage:
  registry garbage-collect <config> [flags]

Flags:
  -m, --delete-untagged   delete manifests that are not currently referenced via tag
  -d, --dry-run           do everything except remove the blobs
  -h, --help              help for garbage-collect
  -q, --quiet             silence output

Copy link
Copy Markdown
Member

@milosgajdos milosgajdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is fine now, but I think we should update the docs, too.
Sorry about not mentioning this on the previous review but would you mind mentioning the new cli switch in

## Run garbage collection

Signed-off-by: Rafael Fonseca <r4f4rfs@gmail.com>
@r4f4
Copy link
Copy Markdown
Contributor Author

r4f4 commented Feb 3, 2025

The code is fine now, but I think we should update the docs, too. Sorry about not mentioning this on the previous review but would you mind mentioning the new cli switch in

## Run garbage collection

Good call. I've added --delete-untagged and --quiet to the garbage-collection docs.

Copy link
Copy Markdown
Member

@milosgajdos milosgajdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator

@wy65701436 wy65701436 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@milosgajdos milosgajdos merged commit 63d3892 into distribution:main Feb 13, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants