Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
davidmalott opened this issue Sep 2, 2021 · 2 comments

Comments

@davidmalott
Copy link

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)

@davidmalott
Copy link
Author

if config.OpenShift {

appears to be the culprit, for openshift schemas, the logic to determine apiVersion for reference is ignored since you are returning before it is processed.

@davidmalott
Copy link
Author

I have created a PR to fix this: #314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant