This commit replaces `ensure.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.
Prior to this commit, temporary directory created using `ensure.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
defer func() {
if err := os.RemoveAll(dir); err != nil {
t.Fatal(err)
}
}
is also tedious, but `t.TempDir` handles this for us nicely.
Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
At this time both Go 1.19 and 1.20 are supported. The version
specified in the go.mod file is the minimum version we expect Helm
to be compiled against. This is the oldest supported version to
support environments where others compile Helm. The Helm project
is using Go 1.20 to build Helm itself.
Updating to Go 1.19 also includes dealing with io/ioutil
deprecation and some additional linting issues around staticcheck.
All the staticcheck issues were in test files so linting was
skipped for those.
Signed-off-by: Matt Farina <matt.farina@suse.com>
With Cobra 1.0, it is now possible to control when file completion
should or should not be done. For example:
helm list <TAB>
should not trigger file completion since 'helm list' does not accept
any arguments.
This commit disables file completion when appropriate and adds tests to
verify that file completion is properly disabled.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
* allow repository config via cli
* make `helm repo add` create repo config file if it does not exist
* squash a ton of bugs
Signed-off-by: Adam Reese <adam@reese.io>
If starter template path is an absolute path, it shouldn't
be prefixed with c.home.Starters() but rather be used as is.
Signed-off-by: Tine Jozelj <tine.jozelj@tjo.space>
When creating a Helm chart for the first time, the assumption should be that the app version is also 0.1.0, implying this is for a new application.
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
It is now possible to create plugins with chart download capabilities for custom, non-http protocols.
Furthermore it is possible to reuse helm packages to implement alternative clients with these custom downloader functions.