Description of problem:
Deployments are not pruned when invoking "oc adm prune deployments"
Version-Release number of selected component (if applicable): 4.6
Steps to Reproduce:
1. Create Deployment
2. Attempt to use oc adm prune deployment
No deployments are pruned
Deployments are pruned as documented
Upstream documentation reference that ReplicaSet's are now used by Deployments instead of ReplicationControllers
Source code makes use of ReplicationControllers:
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.
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
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.
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.
(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.