Bug 1911487

Summary: Pruning Deployments should use ReplicaSets instead of ReplicationController
Product: OpenShift Container Platform Reporter: Andrew Block <andrew.block>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: zhou ying <yinzhou>
Severity: low Docs Contact:
Priority: low    
Version: 4.6CC: aabhishe, alchan, aos-bugs, jokerman, mfojtik, mjahangi, vcojot
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:49:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Andrew Block 2020-12-29 17:35:40 UTC
Description of problem:

Deployments are not pruned when invoking "oc adm prune deployments"

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

How reproducible:


Steps to Reproduce:
1. Create Deployment
2. Attempt to use oc adm prune deployment

Actual results:

No deployments are pruned

Expected results:

Deployments are pruned as documented

Additional info:

Upstream documentation reference that ReplicaSet's are now used by Deployments instead of ReplicationControllers


Source code makes use of ReplicationControllers:


Comment 2 Maciej Szulik 2021-01-05 11:25:07 UTC
oc adm prune deployments ONLY prune Deployment Configs and not Deployments. Adding the latter requires an RFE.

The only bits I'll fix in this current BZ is to make it explicit that this command is about Deployment Configs.

Comment 5 zhou ying 2021-01-11 07:13:26 UTC
The issue has fixed:

[root@dhcp-140-138 ~]# oc adm prune -h
Remove older versions of resources from the server

  deployments Remove old completed and failed deployment configs

[root@dhcp-140-138 ~]# oc adm prune deployments -h
Prune old completed and failed deployment configs

 By default, the prune operation performs a dry run making no changes to the deployment configs. A --confirm flag is
needed for changes to be effective.

[root@dhcp-140-138 ~]# oc version --client
Client Version: 4.7.0-202101092121.p0-eeb9d6d

Comment 8 errata-xmlrpc 2021-02-24 15:49:11 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

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


Comment 9 Selim Jahangir 2021-03-11 22:59:13 UTC
Hi zhou ying,
The issue has been resolved for ocp4.7. Any plan to backport the solution for ocp4.6  ?
My client is now on 4.5 and planned to upgrade to ocp4.6 but not 4.7 yet ? 

Will appreciate your feedback. 


Comment 10 Maciej Szulik 2021-03-16 09:59:53 UTC
(In reply to Selim Jahangir from comment #9)
> Hi zhou ying,
> The issue has been resolved for ocp4.7. Any plan to backport the solution
> for ocp4.6  ?
> My client is now on 4.5 and planned to upgrade to ocp4.6 but not 4.7 yet ? 

This was not fixed, we only updated our help to be more explicit that this is pruning deployment configs not deployments.
The actual fix is an RFE see https://issues.redhat.com/browse/RFE-1524 and since that is a feature it won't be backported.