pull/31906/merge
Abi 1 week ago committed by GitHub
commit 398c3fbd43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -30,9 +30,17 @@ type base struct {
func newBase(source string) base {
settings := cli.New()
pluginsDirectory := settings.PluginsDirectory
for _, dir := range filepath.SplitList(settings.PluginsDirectory) {
if dir != "" {
pluginsDirectory = dir
break
}
}
return base{
Source: source,
PluginsDirectory: settings.PluginsDirectory,
PluginsDirectory: pluginsDirectory,
}
}

@ -14,6 +14,8 @@ limitations under the License.
package installer // import "helm.sh/helm/v4/internal/plugin/installer"
import (
"path/filepath"
"strings"
"testing"
)
@ -27,11 +29,22 @@ func TestPath(t *testing.T) {
source: "",
helmPluginsDir: "/helm/data/plugins",
expectPath: "",
}, {
},
{
source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: "/helm/data/plugins",
expectPath: "/helm/data/plugins/helm-secrets",
},
{
source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: strings.Join([]string{"/helm/data/plugins", "/helm/nfs/plugins"}, string(filepath.ListSeparator)),
expectPath: "/helm/data/plugins/helm-secrets",
},
{
source: "https://github.com/jkroepke/helm-secrets",
helmPluginsDir: strings.Join([]string{"", "/helm/nfs/plugins"}, string(filepath.ListSeparator)),
expectPath: "/helm/nfs/plugins/helm-secrets",
},
}
for _, tt := range tests {

Loading…
Cancel
Save