Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rickducott
Copy link

@rickducott rickducott commented Apr 14, 2019

BOT NOTES:
resolves #121
resolves #122

@soloio-bot
Copy link

Issues linked to changelog:
#121
#122

fsutils/afero.go Outdated
"github.com/spf13/afero"
)

func SetupTemporaryFiles(fs afero.Fs) (file afero.File, dir string, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a utils lib like this is useful, but I feel this function is too specific to get any reuse outside of github archive downloads. The resources it creates tar-dir- and tar-file- are pretty specific.
How about moving this to the helm chart package where it's used or renaming it something like SetupTemporaryFilesForGitArchive

Copy link
Author

Choose a reason for hiding this comment

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

So I actually copied them over from solobot and didn’t want to modify or make private here so I could delete them there. Don’t mind leaving them in helm / install utils, but in the solobot case it’s for changelog verification, nothing to do with helm.

Copy link
Author

Choose a reason for hiding this comment

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

On second thought, you're right -- added a better utility and moved these to private helpers. Should be pretty easy to make use of the new function in solobot.

fsutils/afero.go Outdated
return "", err
}
if len(files) != 1 {
return "", fmt.Errorf("expected only one folder from archive tar, found (%d)", len(files))
Copy link
Contributor

Choose a reason for hiding this comment

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

similar comment to above, this util has some strong assumptions, consider privatizing it or renaming

Copy link
Author

Choose a reason for hiding this comment

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

fixed

Context("load from github", func() {
It("works for a single chart", func() {
ref := GithubChartRef{
Ref: "c00d740c83ec5b5439bf2f58fee110a546af7177",
Copy link
Contributor

Choose a reason for hiding this comment

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

good idea locking to a ref, was going to suggest you make some dummy helm resources in this repo's test resources directory. Might still be worth doing so you can test various helm ignore rules.
Though it produces a chicken-and-egg problem, can't test against it till it merges

Copy link
Author

Choose a reason for hiding this comment

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

FWIW the helm ignore rules are designed to be used during packaging, not rendering. So I'm not sure there's a ton of value in adding testing around that. That said, I did take a look at a few of the charts and rendered manifests just to make sure things checked out.

fsutils/afero.go Outdated
@@ -0,0 +1,42 @@
package fsutils
Copy link
Contributor

Choose a reason for hiding this comment

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

consider calling this vfsutils as it seems to be oriented towards virtual filesystems

Copy link
Contributor

@mitchdraft mitchdraft left a comment

Choose a reason for hiding this comment

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

looks good @rickducott, I have some small comments, looks like you might still be iterating, let me know when I should take another look

@rickducott
Copy link
Author

Thanks @mitchdraft, done iterating -- could you take another look?

Copy link
Contributor

@mitchdraft mitchdraft left a comment

Choose a reason for hiding this comment

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

looks good

@soloio-bulldozer soloio-bulldozer bot merged commit 4eee71a into master Apr 15, 2019
@soloio-bulldozer soloio-bulldozer bot deleted the helm-from-github branch April 15, 2019 08:34
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.

Move solobot afero utils to go-utils Add support for rendering chart/manifests from github folder

3 participants