Project

Profile

Help

Story #5179

As a user I can recursively remove docker content units.

Added by ipanova@redhat.com 4 months ago. Updated 2 months ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Platform Release:
Blocks Release:
Target Release - Docker:
Backwards Incompatible:
No
Groomed:
Yes
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 58

Description

Workflow

Removal of docker content unit would allow removal of the content unit in question if no content unit on a higher level references it. If it can be removed, all (otherwise unused) content units on lower levels are removed recursively.

  • When a docker image manifest is removed, all its blobs( not referenced by other image manifests) are removed as well. If docker manifest is referenced by tags, or by manifest lists, removal is not possible.
  • When a docker manifest list is removed, all its manifests( not referenced by other manifests lists and not tagged) are removed as well. Furthermore, same story with the blobs. If docker manifest list is referenced by tags, removal is not possible unless force flag is specified.
  • (Behavior change from pulp 2) When a tag is removed, all unreferenced content is also removed. If a tagged manifest/manifest_list has other tags or other references, only the tag is removed.
  • Removal of blobs will not be possible unless it has no references.

Endpoint
POST v3/docker/recursive-remove content_hrefs=[] repo/repo_version=X

Notes
When removal is not possible because of higher level references, a list of _hrefs of those references will be returned along with the user friendly message.


Related issues

Related to Docker Support - Story #5232: As a user I can remove docker content units with a force flag NEW Actions
Related to Docker Support - Story #5322: As a user I have retuned a list of references that prevent recursive removal NEW Actions

Associated revisions

History

#1 Updated by ipanova@redhat.com 4 months ago

  • Description updated (diff)

#2 Updated by ipanova@redhat.com 4 months ago

  • Subject changed from As a user I can remove and forcely remove docker content units. to As a user I can remove and forcefully remove docker content units.
  • Description updated (diff)

#3 Updated by ipanova@redhat.com 4 months ago

  • Description updated (diff)

#4 Updated by gmbnomis 4 months ago

Thanks for writing this up! I have just two comments:

  • For the sake of completeness, we should specify what happens on blob removal. Proposal: without "force" it works analogously to the other artifact types, i.e. removal is not possible if any manifest refers to it. "force" is not supported for blobs(?) (I think this operation does not make much sense)
  • For the regular case (not forced): If the removal of an artifact is not possible because there are references to the artifact, what information about these references do we give back to the caller? (no information at all, single reference that caused the error, all references that point to the artifact. I have no idea about the overhead created by these options)

Question

When we remove tag with force flag do we want to recursively remove content units on lower levels?

I think we don't. This functionality looks unrelated to "force". For all other artifact type "force" says "delete on higher levels as well". If there is a need for recursive delete for tags, I tend to introduce another flag for it.

#5 Updated by ipanova@redhat.com 4 months ago

gmbnomis wrote:

Thanks for writing this up! I have just two comments:

  • For the sake of completeness, we should specify what happens on blob removal. Proposal: without "force" it works analogously to the other artifact types, i.e. removal is not possible if any manifest refers to it. "force" is not supported for blobs(?) (I think this operation does not make much sense)

Force flag will not be applicable for blobs. In general the plan is to disallow removal of blobs, unless they are orphans.

  • For the regular case (not forced): If the removal of an artifact is not possible because there are references to the artifact, what information about these references do we give back to the caller? (no information at all, single reference that caused the error, all references that point to the artifact. I have no idea about the overhead created by these options)

Probably just the message that it is referenced in other manifests lists or that it has tags, therefore regular removal is not possible. Will it be useful to the user to see the list of digests the artifact is referenced in?

We can keep this in mind, and see that's the overhead whenever we get to the implementation.

Question

When we remove tag with force flag do we want to recursively remove content units on lower levels?

I think we don't. This functionality looks unrelated to "force". For all other artifact type "force" says "delete on higher levels as well". If there is a need for recursive delete for tags, I tend to introduce another flag for it.

#6 Updated by gmbnomis 4 months ago

wrote:

gmbnomis wrote:

  • For the regular case (not forced): If the removal of an artifact is not possible because there are references to the artifact, what information about these references do we give back to the caller? (no information at all, single reference that caused the error, all references that point to the artifact. I have no idea about the overhead created by these options)

Probably just the message that it is referenced in other manifests lists or that it has tags, therefore regular removal is not possible. Will it be useful to the user to see the list of digests the artifact is referenced in?

I was thinking about returning the _href to the artifacts, not the digests. For example, I think this could help the user to make an informed decision whether repeating the removal with "force" is a sensible thing to do.

I agree, that makes sense to me.

#7 Updated by ipanova@redhat.com 3 months ago

  • Description updated (diff)

#8 Updated by ipanova@redhat.com 3 months ago

  • Subject changed from As a user I can remove and forcefully remove docker content units. to As a user I can recursively remove and forcefully remove docker content units.
  • Description updated (diff)

#9 Updated by ipanova@redhat.com 3 months ago

  • Description updated (diff)

#10 Updated by ipanova@redhat.com 3 months ago

  • Related to Story #5232: As a user I can remove docker content units with a force flag added

#11 Updated by ipanova@redhat.com 3 months ago

  • Subject changed from As a user I can recursively remove and forcefully remove docker content units. to As a user I can recursively remove docker content units.

#12 Updated by ipanova@redhat.com 3 months ago

  • Description updated (diff)

#13 Updated by amacdona@redhat.com 3 months ago

  • Description updated (diff)
  • Groomed changed from No to Yes

#14 Updated by amacdona@redhat.com 3 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com

#15 Updated by ipanova@redhat.com 3 months ago

  • Sprint set to Sprint 57

#16 Updated by amacdona@redhat.com 3 months ago

  • Status changed from ASSIGNED to POST

#17 Updated by ipanova@redhat.com 3 months ago

  • Related to Story #5322: As a user I have retuned a list of references that prevent recursive removal added

#18 Updated by rchan 3 months ago

  • Sprint changed from Sprint 57 to Sprint 58

#19 Updated by amacdona@redhat.com 2 months ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

Please register to edit this issue

Also available in: Atom PDF