Description of problem: when a DC has HPA created, oc desribe it will cause panic Version-Release number of selected component (if applicable): $ oc version Client Version: v4.3.0 Server Version: 4.3.0-0.nightly-2019-12-19-204222 Kubernetes Version: v1.16.2 How reproducible: Always Steps to Reproduce: 1. Create dc $ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git 2. Create HPA targeting dc/ruby-ex $ cat > hpa.yaml << EOF apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: test-hpa spec: scaleTargetRef: apiVersion: apps.openshift.io/v1 kind: DeploymentConfig name: ruby-ex minReplicas: 1 maxReplicas: 10 metrics: - type: Resource resource: name: cpu targetAverageUtilization: 50 - type: Resource resource: name: memory targetAverageValue: 200Mi EOF $ oc create -f hpa.yaml 3. Check dc info using 'oc describe' oc describe dc ruby-ex Actual results: 3. it cause panic when run 'oc describe dc ruby-ex' $ oc describe dc ruby-ex panic: converting (v1.HorizontalPodAutoscaler).MaxReplicas to (autoscaling.HorizontalPodAutoscaler).MaxReplicas: Metrics not present in src goroutine 1 [running]: github.com/openshift/oc/pkg/helpers/describe.printAutoscalingInfo(0xc0015fed90, 0x2, 0x2, 0xc001323400, 0xf, 0xc0013233f0, 0x7, 0x33c6520, 0xc000e6e500, 0xc0015b2790) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/pkg/helpers/describe/deployments.go:346 +0xa42 github.com/openshift/oc/pkg/helpers/describe.printDeploymentConfigSpec(0x33c6520, 0xc000e6e500, 0x0, 0x0, 0x0, 0x0, 0xc0013233f0, 0x7, 0x0, 0x0, ...) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/pkg/helpers/describe/deployments.go:299 +0x314 github.com/openshift/oc/pkg/helpers/describe.(*DeploymentConfigDescriber).Describe.func1(0xc0015b2790, 0x32d7ec0, 0xc00136e480) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/pkg/helpers/describe/deployments.go:101 +0x1ed github.com/openshift/oc/pkg/helpers/describe.tabbedString(0xc0015ffa20, 0x7ffc7facda1d, 0x7, 0x0, 0x0) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/pkg/helpers/describe/helpers.go:37 +0xb0 github.com/openshift/oc/pkg/helpers/describe.(*DeploymentConfigDescriber).Describe(0xc0014e1860, 0xc0012494f0, 0xf, 0x7ffc7facda1d, 0x7, 0x1, 0x203000, 0x432ef5, 0xc00167c6e0, 0x7fd7b956b6d6) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/pkg/helpers/describe/deployments.go:79 +0xa9 github.com/openshift/oc/vendor/k8s.io/kubectl/pkg/cmd/describe.(*DescribeOptions).Run(0xc000f3b220, 0x0, 0x2ecfe40) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/vendor/k8s.io/kubectl/pkg/cmd/describe/describe.go:190 +0x4ca github.com/openshift/oc/vendor/k8s.io/kubectl/pkg/cmd/describe.NewCmdDescribe.func1(0xc000c9af00, 0xc0003e1400, 0x2, 0x2) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/vendor/k8s.io/kubectl/pkg/cmd/describe/describe.go:111 +0xa0 github.com/openshift/oc/vendor/github.com/spf13/cobra.(*Command).execute(0xc000c9af00, 0xc0003e13a0, 0x2, 0x2, 0xc000c9af00, 0xc0003e13a0) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:830 +0x2ae github.com/openshift/oc/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000e7c280, 0x2, 0xc000e7c280, 0x2) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:914 +0x2fc github.com/openshift/oc/vendor/github.com/spf13/cobra.(*Command).Execute(...) /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/vendor/github.com/spf13/cobra/command.go:864 main.main() /builddir/build/BUILD/openshift-clients-git-1.60c4109/__gopath/src/github.com/openshift/oc/cmd/oc/oc.go:107 +0x843 Expected results: 4. the command should work without panic and errors Additional info: Also reproduce with openshift-clients-4.3.0-201910250623-88-g6a937dfe, not sure which one is newer ./oc version Client Version: openshift-clients-4.3.0-201910250623-88-g6a937dfe Server Version: 4.3.0-0.nightly-2019-12-19-204222 Kubernetes Version: v1.16.2
Confirmed with latest oc , can't reproduce the issue now: [root@dhcp-140-138 ~]# oc version -o yaml clientVersion: buildDate: "" compiler: gc gitCommit: "" gitTreeState: "" gitVersion: unknown goVersion: go1.13.4 major: "" minor: "" platform: linux/amd64 [root@dhcp-140-138 ~]# oc describe dc ruby-ex Name: ruby-ex Namespace: zytest Created: 49 seconds ago Labels: app=ruby-ex app.kubernetes.io/component=ruby-ex app.kubernetes.io/instance=ruby-ex Annotations: openshift.io/generated-by=OpenShiftNewApp Latest Version: Not deployed Selector: deploymentconfig=ruby-ex Replicas: 1 Autoscaling: between 1 and 10 replicas targeting 50% CPU over all the pods Triggers: Config, Image(ruby-ex@latest, auto=true) Strategy: Rolling Template: .... Events: <none>
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-2020:0581
*** Bug 1869864 has been marked as a duplicate of this bug. ***