Skip to content

feat: parse lockfile information and combine into chart info #285#326

Open
ominiet wants to merge 1 commit into
norwoodj:masterfrom
ominiet:lockfile-constraints
Open

feat: parse lockfile information and combine into chart info #285#326
ominiet wants to merge 1 commit into
norwoodj:masterfrom
ominiet:lockfile-constraints

Conversation

@ominiet

@ominiet ominiet commented Mar 15, 2026

Copy link
Copy Markdown

Parse Chart lockfile information

This PR adds a new function parseChartLockFile in the style of the existing parseChartFile function as mentioned in Issue #285

Changes

  1. Add new function parseChartLockFile that accepts chartInfo from parseChartFile and returns a ChartRequirements struct that may be modified by the information found in Chart.lock or requirements.lock

    1. If no lockfile is found, it will return the ChartRequirements unmodified
    2. If lockfile is found, it will validate the entries in the chart's dependencies list match on index, chart name, and version constraint and, if so, bring exact versions and repository URLs into the ChartRequirements info struct.
  2. Move dependency list sorting to ParseChartInformation

    1. This may be necessary because Chart.lock relies on index ordering of the existing dependencies list. Otherwise, the only identifier is chart name, which may be repeated in a dependency list

Tests

I added one new test into chart_info_test.go, which checks for the final output of ParseChartInformation with aliases, version range constraints and repeated dependencies

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.

1 participant