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

helm lint should allow specifying --kube-version flag #10664

Closed
antoinedeschenes opened this issue Feb 11, 2022 · 12 comments · Fixed by #10677
Closed

helm lint should allow specifying --kube-version flag #10664

antoinedeschenes opened this issue Feb 11, 2022 · 12 comments · Fixed by #10677

Comments

@antoinedeschenes
Copy link
Contributor

We're currently using helm lint to find deprecated API versions in our charts, failing CI on warnings. However, helm assumes that the target Kubernetes version is the one specified through the k8sVersionMajor/k8sVersionMinor vars. The only way to work around this is rebuilding helm with LDFLAGS, or using a Helm release with the proper defaults.

The command-line flag --kube-version currently exists with helm template, helm lint should replicate the behaviour:
#9040

@yxxhero
Copy link
Member

yxxhero commented Feb 12, 2022

@antoinedeschenes The PRs is welcome. Thanks very much.

@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label May 14, 2022
@antoinedeschenes
Copy link
Contributor Author

bump, pr updated

@yxxhero yxxhero removed the Stale label May 17, 2022
@KlavsKlavsen
Copy link

bump.. why is this nice fix being ignored? :(

@yxxhero
Copy link
Member

yxxhero commented Jun 22, 2022

sorry. I will review the PR of this issue later.

@davidgwps
Copy link

any update on this? For our use case we are linting using --strict, currently we are getting failures because the beta version of the HPA API is deprecated in v1.23+, however we have a couple of kube clusters running v1.22 so we don't want them to fail. The autoscaling/v2 API doesn't exist in v1.22 so I can't see a solution apart from removing the --strict from the linter until we use v1.23 everywhere.

Warning:  templates/hpa.yaml: autoscaling/v2beta2 HorizontalPodAutoscaler is deprecated in v1.23+, unavailable in v1.26+; use autoscaling/v2 HorizontalPodAutoscaler

Error: Process completed with exit code 1.

@antoinedeschenes
Copy link
Contributor Author

antoinedeschenes commented Aug 10, 2022

@davidgwps Each helm minor version matches a k8s minor version. You can run lint with different helm versions as a workaround. Also you could support multiple HPA versions using if blocks with Capabilities.APIVersion

@sstarcher
Copy link
Contributor

@antoinedeschenes that does not really seem feasible to me.
Example

  • K8S 1.23
  • Helm 3.8.0

Helm lint will still respond with
batch/v1beta1 CronJob is deprecated in v1.21+, unavailable in v1.25+; use batch/v1 CronJob

Even though batch/v1beta1 cronjob will work fine in 1.23. Any deprecation will fail. You are not suggesting a person should run with Helm that supports 1.21 even though they are running 1.23 are you? If so that could cause other issues and unsupported features.

Capabilities.APIVersion would certainly work though in this case.

@joejulian joejulian added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Oct 14, 2022
@joejulian
Copy link
Contributor

All the bits are there to do this. It should be a fairly easy task. See https://github.com/helm/helm/pull/8608/files#diff-ff8663c8d26f14679a0274ccb7dab29b04bd17084581c573ca06d8fb82d1d154R63-R65 where I call the upstream deprecation library.

@joejulian joejulian removed help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Oct 14, 2022
@joejulian
Copy link
Contributor

Sorry, I totally missed that there's a PR open already.

@github-actions
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Jan 13, 2023
@sstarcher
Copy link
Contributor

Please keep this open

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

Successfully merging a pull request may close this issue.

6 participants