From 7b5b91654fcdff475ed34e55421081876c0cf77e Mon Sep 17 00:00:00 2001 From: Masatoshi Tsushima Date: Tue, 30 May 2017 19:06:19 +0900 Subject: [PATCH] Adding recreate_pods option --- main.go | 6 ++++++ plugin.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/main.go b/main.go index dad6834..e13ef66 100644 --- a/main.go +++ b/main.go @@ -78,6 +78,11 @@ func main() { Usage: "if set, will wait until all Pods, PVCs, and Services are in a ready state before marking the release as successful.", EnvVar: "PLUGIN_WAIT,WAIT", }, + cli.BoolFlag{ + Name: "recreate-pods", + Usage: "performs pods restart for the resource if applicable", + EnvVar: "PLUGIN_RECREATE_PODS,RECREATE_PODS", + }, } if err := app.Run(os.Args); err != nil { logrus.Fatal(err) @@ -105,6 +110,7 @@ func run(c *cli.Context) error { Prefix: c.String("prefix"), TillerNs: c.String("tiller-ns"), Wait: c.Bool("wait"), + RecreatePods: c.Bool("recreate-pods"), }, } resolveSecrets(&plugin) diff --git a/plugin.go b/plugin.go index 6ef6343..232d6e2 100644 --- a/plugin.go +++ b/plugin.go @@ -33,6 +33,7 @@ type ( Prefix string `json:"prefix"` TillerNs string `json:"tiller_ns"` Wait bool `json:"wait"` + RecreatePods bool `json:"recreate_pods"` } // Plugin default Plugin struct { @@ -83,6 +84,9 @@ func setPushEventCommand(p *Plugin) { if p.Config.Wait { upgrade = append(upgrade, "--wait") } + if p.Config.RecreatePods { + upgrade = append(upgrade, "--recreate-pods") + } p.Config.HelmCommand = upgrade }