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

[Feature]: Container images are deleted alongside packages #2228

Closed
gcapizzi opened this issue Feb 28, 2023 · 1 comment
Closed

[Feature]: Container images are deleted alongside packages #2228

gcapizzi opened this issue Feb 28, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@gcapizzi
Copy link
Contributor

gcapizzi commented Feb 28, 2023

Background

As an operator
I want to only store container images for packages currently used by the system
So that I don't face increasing costs of storage for running the same amount of apps

Acceptance Criteria

GIVEN I have a package
AND I have uploaded sources for it
WHEN I delete the package
THEN I see the corresponding container image containing the source has been deleted

Dev Notes

See #2112 (comment) for details.

@gcapizzi gcapizzi added the GC label Feb 28, 2023
@gcapizzi gcapizzi added this to the v0.8 milestone Feb 28, 2023
kieron-dev pushed a commit that referenced this issue Mar 7, 2023
Common place for push, delete and get labels from container registry
images

Issue: #2228
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
kieron-dev pushed a commit that referenced this issue Mar 7, 2023
Issue: #2228
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
kieron-dev pushed a commit that referenced this issue Mar 7, 2023
Issue: #2228
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
kieron-dev pushed a commit that referenced this issue Mar 7, 2023
Common place for push, delete and get labels from container registry
images

Issue: #2228
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
kieron-dev pushed a commit that referenced this issue Mar 7, 2023
Issue: #2228
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
@kieron-dev
Copy link
Contributor

kieron-dev commented Mar 9, 2023

We are implementing this by adding a finalizer to CFPackage that deletes the container image from the registry using the docker registry v2 API using the go-containerregistry library. Some interesting observations:

  • Google Artifact Registry will error when deleting an image manifest by digest when there are tags referencing that digest. For that reason we first attempt deleting all tags referencing the digest.
  • ECR deletes the corresponding manifest when the tag is deleted (if there are not other tags referencing it). So with ECR we see errors when we attempt to delete the manifest as it has already gone. So we should see if we can handle a not found error differently.
  • GCR and ACR effectively delete the repository when it contains no images. (I suspect they don't really have a concept of repository and just dynamically show folders in their UIs.)
  • DockerHub does not allow deletion of image manifests via the docker registry v2 API - you have to use its proprietary API 😦

kieron-dev pushed a commit that referenced this issue Mar 9, 2023
Common place for push, delete and get labels from container registry
images

Issue: #2228
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
kieron-dev pushed a commit that referenced this issue Mar 9, 2023
Issue: #2228
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
kieron-dev pushed a commit that referenced this issue Mar 10, 2023
Issue: #2228
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
kieron-dev pushed a commit that referenced this issue Mar 10, 2023
Issue: #2228
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
gcapizzi added a commit that referenced this issue Mar 10, 2023
Issue: #2228
Co-authored-by: Giuseppe Capizzi <gcapizzi@vmware.com>
@gcapizzi gcapizzi modified the milestones: v0.8, v0.7 Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants