Bug 1911487 - Pruning Deployments should use ReplicaSets instead of ReplicationController
Summary: Pruning Deployments should use ReplicaSets instead of ReplicationController
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.7.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-29 17:35 UTC by Andrew Block
Modified: 2021-03-16 09:59 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:49:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 683 0 None closed Bug 1911487: make deployment config explicit for prune deployments 2021-02-21 06:31:27 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:49:25 UTC

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:

Always

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

https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/

Source code makes use of ReplicationControllers:

https://github.com/openshift/oc/blob/master/pkg/cli/admin/prune/deployments/deployments.go#L147

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.

https://access.redhat.com/errata/RHSA-2020:5633

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. 

Regards
selim

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.


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