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

kubernetes-version key is not applied to helm template #18

Closed
FatVader opened this issue Feb 21, 2023 · 3 comments
Closed

kubernetes-version key is not applied to helm template #18

FatVader opened this issue Feb 21, 2023 · 3 comments

Comments

@FatVader
Copy link

Hi!

There is a problem with kubeconform checking dependent of .Capabilities.KubeVersion templates, like:

{{- if and (semverCompare "<1.23-0" (include "kubeVersion" $)) }}
apiVersion: autoscaling/v2beta1
{{- else -}}
apiVersion: autoscaling/v2
{{- end }}
kind: HorizontalPodAutoscaler
...
...

If i want to check this chart by 1.19 k8s version it get failed with:

> helm kubeconform . --kubernetes-version "1.19.3"                                                                                                                     ○ ERROR: Testing failed: kubeconform failed: failed to run kubeconform: rc=1
stdin - HorizontalPodAutoscaler  failed validation: could not find schema for HorizontalPodAutoscaler
Error: plugin "kubeconform" exited with error

As I understood KubeConform is using helm template without --kube-version param, so the chart above templating by native kubectl version (e.g. 1.24.3) and trying to be checked by 1.19.3 schema.

May be I'm doing something wrong but for me this problem was fixed by adding --kube-version argument to source code of plugin_wrapper.py

    if a.kubernetes_version is not None:
        args["helm_tmpl"] += ["--kube-version", a.kubernetes_version]

Maybe it will be helpful to you.

@jtyr
Copy link
Owner

jtyr commented Feb 22, 2023

Please can you submit a PR with this change?

@deriamis
Copy link
Contributor

@jtyr I just ran across this myself, and I created #24 for it.

@jtyr
Copy link
Owner

jtyr commented Aug 30, 2023

Fixed via PR #24.

@jtyr jtyr closed this as completed Aug 30, 2023
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

3 participants