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

fix: don't use untagged on ksnap acr purge #293

Merged
merged 5 commits into from
Jun 20, 2024
Merged
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
3 changes: 2 additions & 1 deletion hack/infra/ksnap-acr.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ resource acr 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' = {

var schedule = '0 1 * * Tue' // 1am UTC every Tuesday

// --untagged appears to be broken: https://github.com/Azure/acr-cli/issues/131
var purgeOldArtifacts = '''
version: v1.1.0
steps:
- cmd: acr purge --filter 'karpenter/snapshot/.*:.*' --ago 30d --untagged
- cmd: acr purge --filter 'karpenter/snapshot/.*:.*' --ago 30d
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will remove any image that is older than 30 days for snapshot images?

I also read about dry run we could use to test some of this if we wanted to add tests for this kind of thing.

--dry-run - Specifies that no data is deleted, but the output is the same as if the command is run without this flag. This parameter is useful for testing a purge command to make sure it does not inadvertently delete data you intend to preserve.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this will remove any image that is older than 30 days for snapshot images?

Yes

--dry-run

Yes, though I'd prefer to check the results of the actual execution instead; don't quite trust --dry-run at this point

disableWorkingDirectoryOverride: true
timeout: 3600
'''
Expand Down