Skip to content

Commit 6b68d5a

Browse files
author
Simon Emms
committed
apply testing
1 parent e6ba35d commit 6b68d5a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

components/installer/cmd/render_apply.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ package cmd
66

77
import (
88
"fmt"
9-
"os"
10-
119
"github.com/gitpod-io/gitpod/installer/pkg/helm"
1210
"github.com/pkg/errors"
1311
"github.com/spf13/cobra"
1412
"helm.sh/helm/v3/pkg/chart"
1513
)
1614

15+
var renderApplyOpts struct {
16+
WriteOnly bool
17+
}
18+
1719
var applyCmd = &cobra.Command{
1820
Use: "apply",
1921
Short: "Applies a configuration to your cluster",
@@ -45,8 +47,12 @@ var applyCmd = &cobra.Command{
4547
return err
4648
}
4749

48-
fmt.Println(*dir)
49-
os.Exit(1)
50+
if renderApplyOpts.WriteOnly {
51+
fmt.Println(fmt.Sprintf(`Installer config rendered to %s.
52+
53+
This can now be installed using Helm.`, *dir))
54+
return nil
55+
}
5056

5157
// Install/upgrade the Helm release
5258
err = helm.InstallOrUpgrade("gitpod", renderOpts.Namespace, *dir)
@@ -60,4 +66,6 @@ var applyCmd = &cobra.Command{
6066

6167
func init() {
6268
renderCmd.AddCommand(applyCmd)
69+
70+
applyCmd.Flags().BoolVar(&renderApplyOpts.WriteOnly, "write-only", false, "if set, the config will be written to disk only and will not be installed")
6371
}

0 commit comments

Comments
 (0)