Bug 1468517 - Error on scaleTargetRef when re-deploying HorizontalPodAutoscaler trom template
Error on scaleTargetRef when re-deploying HorizontalPodAutoscaler trom template
Status: NEW
Product: OpenShift Container Platform
Classification: Red Hat
Component: Metrics (Show other bugs)
3.5.0
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Solly Ross
Junqi Zhao
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-07 06:07 EDT by Nicolas Nosenzo
Modified: 2017-07-10 12:15 EDT (History)
2 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: ---


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

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