Skip to content

Commit

Permalink
fix: lets add a conditional compilation flag
Browse files Browse the repository at this point in the history
so that we can reuse the same code in jx alpha / jx 3.x where we default to helm 3

Signed-off-by: James Strachan <[email protected]>
  • Loading branch information
jstrachan committed Feb 27, 2020
1 parent 8ef772f commit bafcb8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/cmd/opts/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ var (
QuickStartLocationCommandAliases = []string{
QuickStartLocationCommandName + "s", "quickstartloc", "qsloc",
}

// UseHelm3 a conditional compilation flag which is false for jx 2.x builds but for alpha / 3.x builds
// is true to default to only using helm 3
UseHelm3 = false
)

// ModifyDevEnvironmentFn a callback to create/update the development Environment
Expand Down Expand Up @@ -208,12 +212,16 @@ func (o *CommonOptions) NotifyProgress(level LogLevel, format string, args ...in

// NewCommonOptionsWithTerm creates a new CommonOptions instance with given terminal input, output and error
func NewCommonOptionsWithTerm(factory clients.Factory, in terminal.FileReader, out terminal.FileWriter, err io.Writer) *CommonOptions {
return &CommonOptions{
co := &CommonOptions{
factory: factory,
In: in,
Out: out,
Err: err,
}
if UseHelm3 {
co.SetHelm(helm.NewHelmCLI("helm", helm.V3, "", false))
}
return co
}

// NewCommonOptionsWithFactory creates a new CommonOptions instance with the
Expand Down

0 comments on commit bafcb8f

Please sign in to comment.