Skip to content

XXXXX.yaml contains an invalid HorizontalPodAutoscaler (openshift 3.11 strict) #313

@davidmalott

Description

@davidmalott

I am seeing this error:

WARN - web_hpa.yaml contains an invalid HorizontalPodAutoscaler (app-x-hpa) - targetCPUUtilizationPercentage: Additional property targetCPUUtilizationPercentage is not allowed`

using flags --openshift --strict -v 3.11.0 on the following yaml construct:

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: app-x-hpa
spec:
  maxReplicas: 15
  minReplicas: 3
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: app-x-deployment
  targetCPUUtilizationPercentage: 60
status:
  conditions: []
  currentMetrics: []
  currentReplicas: 0
  desiredReplicas: 0

furthermore, the status values are not required, yet --strict fails if they are not defined.

Using kubeval version :

15:03 $ kubeval --version
Version: 0.16.1
Commit: f5dba6b486fa18b9179b91e15eb6f2b0f7a5a69e
Date: 2021-03-30T15:17:06Z

Originally posted by @davidmalott in #57 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions