Bug 1452021 - HPA API wrongly uses v2alpha1 rather than v1
Summary: HPA API wrongly uses v2alpha1 rather than v1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Solly Ross
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-18 07:45 UTC by Xingxing Xia
Modified: 2017-08-16 19:51 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-10 05:24:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1716 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.6 RPM Release Advisory 2017-08-10 09:02:50 UTC

Description Xingxing Xia 2017-05-18 07:45:28 UTC
Description of problem:
HPA API wrongly uses v2alpha1 rather than v1. See https://github.com/openshift/origin/issues/14165. Affected card: https://trello.com/c/kj6KUWRF/ . Drafting this bug for QE to track.

Version-Release number of selected component (if applicable):
openshift v3.6.76
kubernetes v1.6.1+5115d708d7

How reproducible:
Always

Steps to Reproduce:
1. Create DCs
$ $ oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json

2. Then create HPA via CLI:
$ oc autoscale dc/database --min=2 --max=10

3. Create HPA via web:
On web console dc page for frontend, Actions --> Add Autoscaler, input parameters, then Save

Actual results:
2 and 3:
After HPA created, check their API
$ oc get HPA -o yaml

Their API uses v2alpha1 rather than v1

Expected results:
2 and 3:
Should use API autoscaling/v1

Additional info:

Comment 1 Zhang Cheng 2017-05-19 03:19:11 UTC
apiVersion is v1 in upstream, but is v2alpha1 in OCP3.6 as below.

$ oc create -f rc-hello-hpa.yaml
replicationcontroller "hello-hpa" created
$ oc autoscale rc hello-hpa --min=2 --max=10
replicationcontroller "hello-hpa" autoscaled
$ oc get hpa
NAME        REFERENCE                         TARGETS           MINPODS   MAXPODS   REPLICAS   AGE
hello-hpa   ReplicationController/hello-hpa   <unknown> / 80%   2         10        0          4s
$ oc get hpa -o yaml
apiVersion: v1
items:
- apiVersion: autoscaling/v2alpha1
  kind: HorizontalPodAutoscaler
  metadata:
    creationTimestamp: 2017-05-19T03:12:07Z
    name: hello-hpa
    namespace: test
    resourceVersion: "2267"
    selfLink: /apis/autoscaling/v2alpha1/namespaces/test/horizontalpodautoscalers/hello-hpa
    uid: f0eb6de5-3c40-11e7-a2b9-0e631526fd50
  spec:
    maxReplicas: 10
    metrics:
    - resource:
        name: cpu
        targetAverageUtilization: 80
      type: Resource
    minReplicas: 2
    scaleTargetRef:
      apiVersion: v1
      kind: ReplicationController
      name: hello-hpa
  status:
    currentMetrics: null
    currentReplicas: 0
    desiredReplicas: 0
kind: List
metadata: {}
resourceVersion: ""
selfLink: ""

Comment 2 openshift-github-bot 2017-05-21 07:46:53 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/59eac282082e8547b97a414586e629a99cadc848
UPSTREAM: 45741: Fix discovery version for autoscaling to be v1

The order of the storage setup blocks in the setup for the autoscaling
API group was accidentally inverted, meaning that if the v2alpha1 API
group was turned on, it would be set to the preferred API group-version
for discovery.

This was unintentional; the latest stable version should (v1) should be
preferred instead.

Fixes bug 1452021 (https://bugzilla.redhat.com/show_bug.cgi?id=1452021)

Comment 4 Xingxing Xia 2017-06-05 09:16:09 UTC
Verified in OCP openshift/oc v3.6.94.
HPA created from CLI or web both show correct api version autoscaling/v1:
$ oc get hpa -o yaml
apiVersion: autoscaling/v1

(BTW, however, another issue - bug 1458663 is reported)

Comment 6 errata-xmlrpc 2017-08-10 05:24:06 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, 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/RHEA-2017:1716


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