Skip to content

Add a new command to setup a cleanup policy for functions artifacts #8268

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

Merged
merged 12 commits into from
Mar 14, 2025

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Feb 27, 2025

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 --days option.

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.

@taeold taeold changed the title Add new command to setup a cleanup policy for functions artifacts Add a new command to setup a cleanup policy for functions artifacts Mar 10, 2025
@taeold taeold marked this pull request as ready for review March 12, 2025 22:13
@taeold taeold requested review from inlined and blidd-google March 12, 2025 22:13
Copy link
Member

@inlined inlined left a comment

Choose a reason for hiding this comment

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

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)?

@taeold
Copy link
Contributor Author

taeold commented Mar 14, 2025

@inlined yep that's the plan. Added that work in go/firebase-tools-14, and will work on it soon.

@taeold taeold enabled auto-merge (squash) March 14, 2025 17:13
@taeold taeold merged commit 3bb75a0 into master Mar 14, 2025
53 of 55 checks passed
@taeold taeold deleted the dl-artifacts-cleanup-policy branch March 14, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants