mirror of
https://github.com/ipedrazas/drone-helm.git
synced 2026-06-04 18:24:13 +08:00
cleanup
This commit is contained in:
@@ -103,16 +103,12 @@ func runCommand(params []string) error {
|
||||
}
|
||||
|
||||
func resolveSecrets(p *Plugin) {
|
||||
fmt.Printf("len: %d \n", len(p.Config.Secrets))
|
||||
if len(p.Config.Secrets) > 0 {
|
||||
for _, secret := range p.Config.Secrets {
|
||||
fmt.Printf("secret: %s \n", secret)
|
||||
if strings.Contains(p.Config.Values, secret) {
|
||||
envval := os.Getenv(secret)
|
||||
fmt.Printf("secret: %s - %s \n", secret, envval)
|
||||
p.Config.Values = strings.Replace(p.Config.Values, secret, envval, -1)
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt.Println(p)
|
||||
}
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ func TestResolveSecrets(t *testing.T) {
|
||||
DryRun: true,
|
||||
Chart: "./chart/test",
|
||||
Release: "test-release",
|
||||
Values: "image.tag=${TAG},api=${API_SERVER},nameOverride=my-over-app,second.tag=${TAG}",
|
||||
Values: "image.tag=TAG,api=API_SERVER,nameOverride=my-over-app,second.tag=TAG",
|
||||
Secrets: secrets,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user