Skip to content

Commit 9ca6c73

Browse files
committed
add new skip-charts flag for so that repeated can bypass chart reinstalls
1 parent c038dd4 commit 9ca6c73

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

cmd/dartboard/main.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,16 @@ func main() {
5252
Action: subcommands.Deploy,
5353
Flags: []cli.Flag{
5454
&cli.BoolFlag{
55-
Name: subcommands.ArgSkipApply,
56-
Value: false,
57-
Usage: "skip `tofu apply`, assume apply was already called",
55+
Name: subcommands.ArgSkipApply,
56+
Value: false,
57+
Usage: "skip 'tofu apply', assume apply was already called",
58+
DefaultText: "false",
59+
},
60+
&cli.BoolFlag{
61+
Name: subcommands.ArgSkipCharts,
62+
Value: false,
63+
Usage: "skip 'helm install' for all charts, assume charts have already been installed for upstream and tester clusters",
64+
DefaultText: "false",
5865
},
5966
},
6067
},

cmd/dartboard/subcommands/deploy.go

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ func Deploy(cli *cli.Context) error {
5858
if err = tf.Apply(); err != nil {
5959
return err
6060
}
61+
} else {
62+
if err = tf.Output(nil, false); err != nil {
63+
return err
64+
}
6165
}
6266

6367
clusters, custom_clusters, err := tf.ParseOutputs()
@@ -67,7 +71,7 @@ func Deploy(cli *cli.Context) error {
6771

6872
// Helm charts
6973
tester := clusters["tester"]
70-
if len(tester.Kubeconfig) > 0 {
74+
if len(tester.Kubeconfig) > 0 && !cli.Bool(ArgSkipCharts) {
7175
if err = chartInstall(tester.Kubeconfig, chart{"k6-files", "tester", "k6-files"}, nil); err != nil {
7276
return err
7377
}
@@ -97,25 +101,27 @@ func Deploy(cli *cli.Context) error {
97101
}
98102
}
99103

100-
if err = chartInstallCertManager(r, &upstream); err != nil {
101-
return err
102-
}
103-
if err = chartInstallRancher(r, rancherImageTag, &upstream); err != nil {
104-
return err
105-
}
106-
if err = chartInstallRancherIngress(&upstream); err != nil {
107-
return err
108-
}
109-
if err = chartInstallCgroupsExporter(&upstream); err != nil {
110-
return err
111-
}
104+
if !cli.Bool(ArgSkipCharts) {
105+
if err = chartInstallCertManager(r, &upstream); err != nil {
106+
return err
107+
}
108+
if err = chartInstallRancher(r, rancherImageTag, &upstream); err != nil {
109+
return err
110+
}
111+
if err = chartInstallRancherIngress(&upstream); err != nil {
112+
return err
113+
}
114+
if err = chartInstallCgroupsExporter(&upstream); err != nil {
115+
return err
116+
}
112117

113-
// Wait for Rancher deployments to be complete, or subsequent steps may fail
114-
if err = kubectl.WaitRancher(upstream.Kubeconfig); err != nil {
115-
return err
116-
}
117-
if err = chartInstallRancherMonitoring(r, &upstream); err != nil {
118-
return err
118+
// Wait for Rancher deployments to be complete, or subsequent steps may fail
119+
if err = kubectl.WaitRancher(upstream.Kubeconfig); err != nil {
120+
return err
121+
}
122+
if err = chartInstallRancherMonitoring(r, &upstream); err != nil {
123+
return err
124+
}
119125
}
120126

121127
// Setup rancher client

cmd/dartboard/subcommands/utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ import (
3131
)
3232

3333
const (
34-
ArgDart = "dart"
35-
ArgSkipApply = "skip-apply"
34+
ArgDart = "dart"
35+
ArgSkipApply = "skip-apply"
36+
ArgSkipCharts = "skip-charts"
3637
)
3738

3839
type clusterAddress struct {

0 commit comments

Comments
 (0)