Bug 1468517 - Error on scaleTargetRef when re-deploying HorizontalPodAutoscaler trom template [NEEDINFO]
Error on scaleTargetRef when re-deploying HorizontalPodAutoscaler trom template
Status: ASSIGNED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.5.0
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Fabiano Franz
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-07 06:07 EDT by Nicolas Nosenzo
Modified: 2017-10-03 15:36 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
sross: needinfo? (nnosenzo)


Attachments (Terms of Use)

  None (edit)
Description Nicolas Nosenzo 2017-07-07 06:07:40 EDT
Description of problem:

When re-deploying an HPA object from a template file, it fails on time to time with error:

error: unable to find api field in struct HorizontalPodAutoscalerSpec for the json field "scaleRef"


Version-Release number of selected component (if applicable):

Tested on oc v3.5 and v3.4.1.7

How reproducible:

Intermittent issue

Steps to Reproduce:

1. Create a template containing the HPA object:

# cat hpa-template.yaml 
kind: "Template"
apiVersion: "v1"
metadata:
  name: "template"
  annotations:
    description: "template."
labels:
  template: "template"
objects:
- apiVersion: autoscaling/v1
  kind: HorizontalPodAutoscaler
  metadata:
    name: dataservice-db-autoscaler
  spec:
    scaleTargetRef:
      kind: DeploymentConfig
      name: ruby-ex
      apiVersion: v1
      subresource: scale
    minReplicas: 1
    maxReplicas: 1
    cpuUtilization:
      targetPercentage: 100


2. Re-deploy the object processing the template file:

# for i in $(seq 1 15); do oc process -f hpa-template.yaml | oc apply -f -;done

Actual results:

horizontalpodautoscaler "dataservice-db-autoscaler" configured
error: unable to find api field in struct HorizontalPodAutoscalerSpec for the json field "scaleRef"
horizontalpodautoscaler "dataservice-db-autoscaler" configured
error: unable to find api field in struct HorizontalPodAutoscalerSpec for the json field "scaleRef"
horizontalpodautoscaler "dataservice-db-autoscaler" configured
error: unable to find api field in struct HorizontalPodAutoscalerSpec for the json field "scaleRef"
error: unable to find api field in struct HorizontalPodAutoscalerSpec for the json field "scaleRef"
error: unable to find api field in struct HorizontalPodAutoscalerSpec for the json field "scaleRef"
horizontalpodautoscaler "dataservice-db-autoscaler" configured
horizontalpodautoscaler "dataservice-db-autoscaler" configured
horizontalpodautoscaler "dataservice-db-autoscaler" configured
horizontalpodautoscaler "dataservice-db-autoscaler" configured
horizontalpodautoscaler "dataservice-db-autoscaler" configured
horizontalpodautoscaler "dataservice-db-autoscaler" configured
horizontalpodautoscaler "dataservice-db-autoscaler" configured


Expected results:

horizontalpodautoscaler should be re-configured each time without errors.

Additional info:
Comment 1 Joel Takvorian 2017-07-07 09:08:20 EDT
It looks identical to this k8s issue: https://github.com/kubernetes/kubernetes/issues/34413
Comment 2 Solly Ross 2017-10-03 15:36:44 EDT
that PR should have been included in v3.5 (but not v3.4).  Can you please make sure you're using the most recent version of v3.5 (and make sure that you're using a v3.5 version of `oc`)?

At any rate, this is a CLI issue, bouncing over to them.

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