GoogleCloudPlatform / gcr-cleaner

Delete untagged image refs in Google Container Registry or Artifact Registry
Apache License 2.0
805 stars 112 forks source link

Library function uses fmt.Printf #55

Closed tenevdev closed 3 years ago

tenevdev commented 3 years ago

The current behaviour is that when dryRun is true, the Clean function has the side-effect of printing many lines of output about what images and tags will be deleted.

As a user of the library, this is pretty annoying because I may not want to display this output in my own tools.

I think we can refactor the library code to communicate this information as a return value of the function and the executables in this project can use that value to print the same output as before.

The workaround for when you need no output or different output is an approach such as github.com/PumpkinSeed/cage.