Add a new command to setup a cleanup policy for functions artifacts#8268
Merged
Add a new command to setup a cleanup policy for functions artifacts#8268
Conversation
inlined
reviewed
Mar 13, 2025
inlined
approved these changes
Mar 14, 2025
Member
inlined
left a comment
There was a problem hiding this comment.
LGTM. I assume this can go in as reverse compatible and in the vNext branch you're going to take a swing at checking the policy on deployment and removing the ArtifactCleaner (and its related experiments)?
Contributor
Author
|
@inlined yep that's the plan. Added that work in go/firebase-tools-14, and will work on it soon. |
…base/firebase-tools into dl-artifacts-cleanup-policy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add command
functions:artifacts:setpolicy.This new command leverages Artifact Registry's cleanup policies feature. Cleanup policies are a managed service feature that automatically removes container images based on configurable rules, providing a more robust and transparent solution.
The command simplifies the process of configuring these policies for Cloud Run functions repositories. By default, the command sets up a policy that deletes images older than 3 days. Users can easily adjust this retention period using the
--daysoption.The command handles checking if the user already has a cleanup policy set up. The cli command will check if a clean up policy exists, and if so, will prompt the user if they wish to proceed.