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

Openshift case - io.k8s.api.core.v1.LimitRangeItem -> permit Images and ImageStream #20

Open
mmv2010 opened this issue Nov 10, 2022 · 0 comments

Comments

@mmv2010
Copy link

mmv2010 commented Nov 10, 2022

Hi,

For kubernetes-validate module run from ansible, kubernetes version: v1.23.5
validation for size/number of Images and ImageSources on LimitRanges is not under definitions

https://docs.openshift.com/container-platform/4.10/nodes/clusters/nodes-cluster-limit-ranges.html

  • "Image streams: You can set limits on the number of images and tags in an ImageStream object"
  • "Images: You can limit the size of images that can be pushed to an internal registry."

Defining those two limits and apply using ansible fails validation with error message:
"msg": "LimitRange core-resource-limits: resource definition validation error at spec.limits.2.type: 'openshift.io/Images' is not one of ['Container', 'PersistentVolumeClaim', 'Pod']"

Validation process LimitRangeItem does not include these (or should be case for Openshift only)
https://github.com/willthames/kubernetes-validate/blob/main/src/kubernetes_validate/kubernetes-json-schema/v1.23.0-local-strict/_definitions.json#L7209

Check with manual update under _definitions.json
"type": { "enum": [ "Container", "PersistentVolumeClaim", "Pod", "openshift.io/Images", "openshift.io/ImageStream" ]}

Results in proper validation and therefore object is created on the cluster.
localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

Alternative to bypass validate using "strict: no"

Thanks!
Mihai

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