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

Automation to delete OCI cache for provider #323

Open
wagoodman opened this issue Jun 7, 2024 · 0 comments
Open

Automation to delete OCI cache for provider #323

wagoodman opened this issue Jun 7, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@wagoodman
Copy link
Contributor

Today we have provider images that we create daily: https://github.com/orgs/anchore/packages?repo_name=grype-db

We always start with the latest cache on every data sync, however, there are instances where we want to delete todays cache for operational reasons. Ideally this should be done from a workflow that the @anchore/tools team can kick off. This is specifically important since image versions can only be deleted by admins, thus, only a small portion of the team can delete the latest image.

To list packages:

gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /orgs/anchore/packages/container/grype-db%2Fdata%2Fnvd/versions

List package versions: https://docs.github.com/en/rest/packages/packages?apiVersion=2022-11-28#list-package-versions-for-a-package-owned-by-an-organization

Ideally we should delete the package version: https://docs.github.com/en/rest/packages/packages?apiVersion=2022-11-28#delete-package-version-for-an-organization

Question: will this approach work for workflow_dispatch if the user kicking it off does not have admin rights?

@wagoodman wagoodman added the enhancement New feature or request label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant