Bug 1371511 - prune command does ignore namespace parameter
Summary: prune command does ignore namespace parameter
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Maciej Szulik
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-30 11:46 UTC by Alexander Koksharov
Modified: 2019-12-16 06:32 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: oadm prune images|builds|deployments ignored --namespace parameter Consequence: Administrator was not able to limit the scope of prune command to particular namespace. Fix: Make oadm prune command aware of --namespace parameter and limnit the scope of pruning to given namespace. Result: Administrator is able to limit the scope of the command to single namespace. When applied to images, none of images will be removed, since images are non-namespaced.
Clone Of:
Environment:
Last Closed: 2017-01-18 12:52:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 17:23:26 UTC

Description Alexander Koksharov 2016-08-30 11:46:03 UTC
Description of problem:
The following commands select the same set of images to remove, ignoring namespace parameter:
  oc adm prune images > 20160825_prune-images-dry.log
  oc adm prune images --namespace=survey-sla > 20160825_prune-images-dry_survey-sla.log


Version-Release number of selected component (if applicable):
3.2

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Maciej Szulik 2016-09-05 10:05:37 UTC
See discussion in https://github.com/openshift/origin/issues/9502.

Comment 4 Maciej Szulik 2016-10-07 13:23:17 UTC
Should be solved in https://github.com/openshift/origin/pull/11249.

Comment 5 openshift-github-bot 2016-10-09 08:20:43 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/245518d85680ce3709bcc9c331990524f81c7d22
Bug 1371511 - add namespace awareness to oadm prune commands

Comment 6 XiaochuanWang 2016-10-11 01:38:15 UTC
Verified on OCP 
openshift/oc v3.2.1.16

cluster admin could prune images under only specific namespace:
# oc adm prune images --namespace=xiaocwan-t
Dry run enabled - no modifications will be made. Add --confirm to remove images

(to compare:)
# oc adm prune images 
Dry run enabled - no modifications will be made. Add --confirm to remove images
Deleting references from image streams to images ...
STREAM           IMAGE                                                                     TAGS
wewang/myappis   sha256:3fb9fce7bd0fc22dfd75a2a104f2545c877efeb9887be6aecf97d3fc68548ac8   latest

Deleting registry repository layer links ...
REPO             LAYER LINK
wewang/myappis   sha256:fefac1f48e853bd92b8124015a809080efb1cfce1b4c77405b7852ba3b8e108a
wewang/myappis   sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
wewang/myappis   sha256:8d30e94188e7f13642d975e70c484e48c33867f3ede3277df1145803fa996ac1

Deleting registry layer blobs ...
BLOB
sha256:b2c8fd1557f3f8279ef514d846943fbd2b0ac64602dd34e98c186979d3de0e8f
sha256:04a758b33eac9a63088df32821374693ce8c41ca1283f7a2d9de85fb76bb51ff
...

Comment 8 errata-xmlrpc 2017-01-18 12:52:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0066


Note You need to log in before you can comment on or make changes to this bug.