Handle Helm API output which uses non-OS specific path package#42
Open
HarrisonWAffel wants to merge 1 commit intorancher-archives:mainfrom
Open
Handle Helm API output which uses non-OS specific path package#42HarrisonWAffel wants to merge 1 commit intorancher-archives:mainfrom
path package#42HarrisonWAffel wants to merge 1 commit intorancher-archives:mainfrom
Conversation
path packagepath package
path packagepath package
path packagepath package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While running chart tests on windows, I noticed that hull would error out with the following log:
After investigating, this issue seems to stem from how the Helm API returns charts after calling
c.Renderwithin HullsRenderTemplatefunction.As the Helm API recurses through the chart files, it builds out the file paths using the
pathlibrary. Unfortunately, thepathlibrary does not take into account OS specific file separators, onlypath/filepathdoes.Hull will use this output to further render only the yaml files so that they may be tested. However, Hull is (properly) using the
filepath.Seperatorconstant to split template names from their paths to identify the yaml files. By splitting the value using thefilepath.Seperatorconstant, as well as the immediate indexing into the resulting slice, we run into the above error.The fix proposed in this PR is to no longer use the
filepath.Seperatorconstant, as Helm will always return linux path separators. This results in Hull tests working as expected on Windows, and does not impact linux/macos. Changing this in Helm itself would likely be a major breaking change, as this logic has existed for ~7 years.