Bug 2034889
| Summary: | `oc adm prune deployments` does not work | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | zhou ying <yinzhou> |
| Component: | oc | Assignee: | Ross Peoples <rpeoples> |
| oc sub component: | oc | QA Contact: | zhou ying <yinzhou> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | high | ||
| Priority: | high | CC: | aos-bugs, maszulik, mfojtik |
| Version: | 4.10 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.10.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | EmergencyRequest | ||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-03-11 18:15: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: | |
| Embargoed: | |||
|
Description
zhou ying
2021-12-22 11:52:53 UTC
** A NOTE ABOUT USING URGENT ** This BZ has been set to urgent severity and priority. When a BZ is marked urgent priority Engineers are asked to stop whatever they are doing, putting everything else on hold. Please be prepared to have reasonable justification ready to discuss, and ensure your own and engineering management are aware and agree this BZ is urgent. Keep in mind, urgent bugs are very expensive and have maximal management visibility. NOTE: This bug was automatically assigned to an engineering manager with the severity reset to *unspecified* until the emergency is vetted and confirmed. Please do not manually override the severity. ** INFORMATION REQUIRED ** Please answer these questions before escalation to engineering: 1. Has a link to must-gather output been provided in this BZ? We cannot work without. If must-gather fails to run, attach all relevant logs and provide the error message of must-gather. 2. Give the output of "oc get clusteroperators -o yaml". 3. In case of degraded/unavailable operators, have all their logs and the logs of the operands been analyzed [yes/no] 4. List the top 5 relevant errors from the logs of the operators and operands in (3). 5. Order the list of degraded/unavailable operators according to which is likely the cause of the failure of the other, root-cause at the top. 6. Explain why (5) is likely the right order and list the information used for that assessment. 7. Explain why Engineering is necessary to make progress. Checked with latest oc client, still hit error :
[root@localhost ~]# oc adm prune deployments --keep-complete=2 --keep-failed=1 --keep-younger-than=1m --replica-sets=true
Dry run enabled - no modifications will be made. Add --confirm to remove deployments
panic: interface conversion: interface {} is *v1.Deployment, not *v1.DeploymentConfig
goroutine 1 [running]:
github.com/openshift/oc/pkg/cli/admin/prune/deployments.(*dataSet).ListDeployments(0xc000b47f18)
/go/src/github.com/openshift/oc/pkg/cli/admin/prune/deployments/data.go:169 +0x149
github.com/openshift/oc/pkg/cli/admin/prune/deployments.(*perDeploymentResolver).Resolve(0xc000d11de0)
/go/src/github.com/openshift/oc/pkg/cli/admin/prune/deployments/resolvers.go:109 +0x42
github.com/openshift/oc/pkg/cli/admin/prune/deployments.(*mergeResolver).Resolve(0x1)
/go/src/github.com/openshift/oc/pkg/cli/admin/prune/deployments/resolvers.go:28 +0xa2
github.com/openshift/oc/pkg/cli/admin/prune/deployments.(*pruner).Prune(0x401a640, {0x4016d20, 0xc0006d8e10})
/go/src/github.com/openshift/oc/pkg/cli/admin/prune/deployments/prune.go:88 +0x2f
github.com/openshift/oc/pkg/cli/admin/prune/deployments.PruneDeploymentsOptions.Run({0x0, 0x0, 0x1, 0xdf8475800, 0x2, 0x1, {0x0, 0x0}, {0x4016780, 0xc0006f8a40}, ...})
/go/src/github.com/openshift/oc/pkg/cli/admin/prune/deployments/deployments.go:205 +0xaaa
github.com/openshift/oc/pkg/cli/admin/prune/deployments.NewCmdPruneDeployments.func1(0xc000bc8280, {0xc000c86240, 0x0, 0x4})
/go/src/github.com/openshift/oc/pkg/cli/admin/prune/deployments/deployments.go:78 +0x118
github.com/spf13/cobra.(*Command).execute(0xc000bc8280, {0xc000c86200, 0x4, 0x4})
/go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc0008f2a00)
/go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
/go/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:902
k8s.io/component-base/cli.Run(0xc0008f2a00)
/go/src/github.com/openshift/oc/vendor/k8s.io/component-base/cli/run.go:105 +0x389
main.main()
/go/src/github.com/openshift/oc/cmd/oc/oc.go:78 +0x385
[root@localhost ~]# oc version
Client Version: 4.10.0-0.nightly-2021-12-25-025639
Server Version: 4.10.0-0.nightly-2021-12-23-153012
Kubernetes Version: v1.22.1+6859754
[root@localhost ~]# oc version --client -o yaml
clientVersion:
buildDate: "2021-12-24T22:49:12Z"
compiler: gc
gitCommit: 5fe7203294827ca91e2c94d1dacbf23477553ba3
gitTreeState: clean
gitVersion: 4.10.0-202112242226.p0.g5fe7203.assembly.stream-5fe7203
goVersion: go1.17.2
major: ""
minor: ""
platform: linux/amd64
releaseClientVersion: 4.10.0-0.nightly-2021-12-25-025639
[root@localhost oc]# git log
commit 5fe7203294827ca91e2c94d1dacbf23477553ba3 (HEAD -> master, origin/release-4.11, origin/release-4.10, origin/master, origin/HEAD)
Merge: b7970db36 bbfcffdef
Author: OpenShift Merge Robot <openshift-merge-robot.github.com>
Date: Fri Dec 24 21:26:08 2021 +0100
Merge pull request #1005 from deejross/bz2034889-fix-prune-panic
Bug 2034889: Fix prune deployment panic
The panic has fixed , but the prune function still has issue , will verify this one and open a new bug to follow the prune function. oc adm prune deployments --keep-complete=2 --keep-failed=1 --keep-younger-than=1m --replica-sets=true Dry run enabled - no modifications will be made. Add --confirm to remove deployments [root@localhost ~]# oc version --client Client Version: 4.10.0-202201031825.p0.g25851bd.assembly.stream-25851bd |