Skip to content

Skip Helm library charts in resolver#172

Merged
whitemerch merged 1 commit into
mainfrom
chakib.hamie/skip_helm_library_charts
Jun 3, 2026
Merged

Skip Helm library charts in resolver#172
whitemerch merged 1 commit into
mainfrom
chakib.hamie/skip_helm_library_charts

Conversation

@whitemerch
Copy link
Copy Markdown
Contributor

@whitemerch whitemerch commented Jun 2, 2026

Motivation

Helm library charts (type: library) cannot be installed; the scanner was still running the Helm dry-run path and logging errors such as chart is not installable: library charts are not installable (only 'application' type charts are supported), which added noise to service:iac-scanning without improving coverage (library charts have no deployable manifests).

Changes

Resolver

GetType reads Chart.yaml and returns KindCOMMON for type: library, so the Helm resolver is not invoked for those directories (same skip behavior as non-chart paths).

Tests

Fixture test/fixtures/test_helm_library and TestGetType cases for application vs library charts.

Author Checklist

  • I have reviewed my own PR.
  • I have added or updated relevant unit tests where necessary. If no tests are added, I've explained why.
  • All new and existing tests pass.
  • I have tested my changes on staging (if applicable).
  • I have updated any relevant documentation (if applicable).

QA Instruction

CI should pass.

Blast Radius

Only the Helm classification path in pkg/resolver; library chart directories are no longer passed to the Helm renderer.

Additional Notes

I submit this contribution under the Apache-2.0 license.

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Jun 2, 2026

🎯 Code Coverage (details)
Patch Coverage: 83.33%
Overall Coverage: 47.87% (+0.03%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b65148e | Docs | Datadog PR Page | Give us feedback!

@whitemerch whitemerch changed the title [K9VULN-15689] Skip Helm library charts in resolver Skip Helm library charts in resolver Jun 2, 2026
@whitemerch whitemerch force-pushed the chakib.hamie/skip_helm_library_charts branch from 7300569 to 36ee4d3 Compare June 2, 2026 22:22
@whitemerch whitemerch force-pushed the chakib.hamie/skip_helm_library_charts branch from 36ee4d3 to b65148e Compare June 2, 2026 22:31
@whitemerch whitemerch marked this pull request as ready for review June 3, 2026 07:21
@whitemerch whitemerch requested a review from a team as a code owner June 3, 2026 07:21
Copy link
Copy Markdown
Contributor

@ChouraquiBen ChouraquiBen left a comment

Choose a reason for hiding this comment

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

I don't think it is blocking but one question

Comment thread pkg/resolver/resolver.go
if err == nil {
return model.KindHELM
chartFS := os.DirFS(filepath.Clean(filePath))
data, err := fs.ReadFile(chartFS, "Chart.yaml")
Copy link
Copy Markdown
Contributor

@ChouraquiBen ChouraquiBen Jun 3, 2026

Choose a reason for hiding this comment

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

Question: I have rarely seen fs.ReadFile used, usually, it is os.ReadFile, is there a reason why using fs.ReadFile here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I used os.ReadFile and it made go-ci fail from what I recall

@whitemerch whitemerch merged commit 9119e08 into main Jun 3, 2026
19 checks passed
@whitemerch whitemerch deleted the chakib.hamie/skip_helm_library_charts branch June 3, 2026 08:05
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.

2 participants