Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1371511 - prune command does ignore namespace parameter
prune command does ignore namespace parameter
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.2.0
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Maciej Szulik
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-30 07:46 EDT by Alexander Koksharov
Modified: 2017-03-08 13 EST (History)
7 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-01-18 07:52:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 12:23:26 EST

  None (edit)
Description Alexander Koksharov 2016-08-30 07:46:03 EDT
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 06:05:37 EDT
See discussion in https://github.com/openshift/origin/issues/9502.
Comment 4 Maciej Szulik 2016-10-07 09:23:17 EDT
Should be solved in https://github.com/openshift/origin/pull/11249.
Comment 5 openshift-github-bot 2016-10-09 04:20:43 EDT
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-10 21:38:15 EDT
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 07:52:56 EST
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.