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

feat(misconf): add helm-api-version and helm-kube-version flag #6332

Merged
merged 6 commits into from
Apr 6, 2024

Conversation

jkroepke
Copy link
Contributor

@jkroepke jkroepke commented Mar 16, 2024

Description

It resolved the following error, if trivy config is used against a helm chart with minKubeVersion

Before:

2024-03-16T11:47:57.917+0100 DEBUG [misconf] 47:57.917406000 helm.scanner Failed to render Chart files: chart requires kubeVersion: >= 1.22.0-0 which is incompatible with Kubernetes v1.20.0

After:

No error

  • --helm-api-versions maps to helm template --api-versions
  • --helm-kube-version maps to helm template --kube-version

Related Issues:

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@jkroepke jkroepke changed the title misconf: Add helm api-version and kube-version flag fix(misconf): Add helm api-version and kube-version flag Mar 16, 2024
@jkroepke jkroepke changed the title fix(misconf): Add helm api-version and kube-version flag feat(misconf): Add helm api-version and kube-version flag Mar 16, 2024
@jkroepke jkroepke changed the title feat(misconf): Add helm api-version and kube-version flag feat(misconf): Add helm-api-version and helm-kube-version flag Mar 16, 2024
@jkroepke jkroepke changed the title feat(misconf): Add helm-api-version and helm-kube-version flag feat(misconf): add helm-api-version and helm-kube-version flag Mar 16, 2024
@nikpivkin
Copy link
Contributor

Need to update the documentation of the configuration file.

pkg/iac/scanners/helm/parser/parser.go Outdated Show resolved Hide resolved
docs/docs/references/configuration/cli/trivy_aws.md Outdated Show resolved Hide resolved
@nikpivkin
Copy link
Contributor

@jkroepke Thanks for the PR! Left a couple of comments.

@nikpivkin
Copy link
Contributor

@jkroepke Can you update the config file in the documentation?

@jkroepke
Copy link
Contributor Author

@nikpivkin Done. I have fixed the docs a bit, because of the duplicate key helm was mis-leading. Otherwise they can be mis-interpreted and result into a yaml error.

@simar7 simar7 requested a review from chen-keinan March 26, 2024 01:19
Copy link
Member

@simar7 simar7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR, I've left some comments.

@jkroepke jkroepke requested a review from simar7 March 26, 2024 08:17
Copy link
Member

@simar7 simar7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but we will merge in v0.51.0

@simar7
Copy link
Member

simar7 commented Apr 4, 2024

@chen-keinan could you also take a look?

@simar7
Copy link
Member

simar7 commented Apr 4, 2024

@jkroepke sorry but seems like a couple of merge conflicts to take care of as other PRs got merged first. Could you rebase your PR?

# Conflicts:
#	pkg/iac/scanners/helm/test/option_test.go
#	pkg/iac/scanners/helm/test/parser_test.go
@jkroepke
Copy link
Contributor Author

jkroepke commented Apr 4, 2024

@simar7 Done

@simar7 simar7 enabled auto-merge April 6, 2024 05:07
@simar7 simar7 added this pull request to the merge queue Apr 6, 2024
Merged via the queue into aquasecurity:main with commit 53517d6 Apr 6, 2024
17 checks passed
@jkroepke jkroepke deleted the helm-versions branch April 6, 2024 07:46
fl0pp5 pushed a commit to altlinux/trivy that referenced this pull request May 6, 2024
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

Successfully merging this pull request may close these issues.

None yet

5 participants