mirror of
https://github.com/ipedrazas/drone-helm.git
synced 2026-06-26 15:52:33 +08:00
Merge pull request #83 from Kayuii/master
fix TestHelmInitByAliyunStableRepo
This commit is contained in:
@@ -159,7 +159,7 @@ func main() {
|
||||
EnvVar: "PLUGIN_UPDATE_DEPENDENCIES,UPDATE_DEPENDENCIES",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "stable-repo-url",
|
||||
Name: "stable_repo_url",
|
||||
Usage: "URL for stable repository (default 'https://kubernetes-charts.storage.googleapis.com')",
|
||||
EnvVar: "PLUGIN_STABLE_REPO_URL,STABLE_REPO_URL",
|
||||
},
|
||||
|
||||
@@ -399,6 +399,7 @@ func (p *Plugin) debug() {
|
||||
fmt.Printf("Secrets: %s \n", p.Config.Secrets)
|
||||
fmt.Printf("Helm Repos: %s \n", p.Config.HelmRepos)
|
||||
fmt.Printf("ValuesFiles: %s \n", p.Config.ValuesFiles)
|
||||
fmt.Printf("StableRepoURL: %s \n", p.Config.StableRepoURL)
|
||||
kubeconfig, err := ioutil.ReadFile(KUBECONFIG)
|
||||
if err == nil {
|
||||
fmt.Println(string(kubeconfig))
|
||||
|
||||
@@ -573,11 +573,7 @@ func TestHelmInitByAliyunStableRepo(t *testing.T) {
|
||||
}
|
||||
init := doHelmInit(plugin)
|
||||
result := strings.Join(init, " ")
|
||||
expected := "init "
|
||||
if plugin.Config.StableRepoURL != "" {
|
||||
expected = expected + "--stable-repo-url"
|
||||
}
|
||||
|
||||
expected := "init --stable-repo-url " + plugin.Config.StableRepoURL
|
||||
if expected != result {
|
||||
t.Error("Helm cannot init for stable repository")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user