Add a parameter "create_namespace"
This commit is contained in:
@@ -11,18 +11,19 @@ type Upgrade struct {
|
||||
chart string
|
||||
release string
|
||||
|
||||
chartVersion string
|
||||
dryRun bool
|
||||
wait bool
|
||||
values string
|
||||
stringValues string
|
||||
valuesFiles []string
|
||||
reuseValues bool
|
||||
timeout string
|
||||
force bool
|
||||
atomic bool
|
||||
cleanupOnFail bool
|
||||
certs *repoCerts
|
||||
chartVersion string
|
||||
dryRun bool
|
||||
wait bool
|
||||
values string
|
||||
stringValues string
|
||||
valuesFiles []string
|
||||
reuseValues bool
|
||||
timeout string
|
||||
force bool
|
||||
atomic bool
|
||||
cleanupOnFail bool
|
||||
certs *repoCerts
|
||||
createNamespace bool
|
||||
|
||||
cmd cmd
|
||||
}
|
||||
@@ -30,21 +31,22 @@ type Upgrade struct {
|
||||
// NewUpgrade creates an Upgrade using fields from the given Config. No validation is performed at this time.
|
||||
func NewUpgrade(cfg env.Config) *Upgrade {
|
||||
return &Upgrade{
|
||||
config: newConfig(cfg),
|
||||
chart: cfg.Chart,
|
||||
release: cfg.Release,
|
||||
chartVersion: cfg.ChartVersion,
|
||||
dryRun: cfg.DryRun,
|
||||
wait: cfg.Wait,
|
||||
values: cfg.Values,
|
||||
stringValues: cfg.StringValues,
|
||||
valuesFiles: cfg.ValuesFiles,
|
||||
reuseValues: cfg.ReuseValues,
|
||||
timeout: cfg.Timeout,
|
||||
force: cfg.Force,
|
||||
atomic: cfg.AtomicUpgrade,
|
||||
cleanupOnFail: cfg.CleanupOnFail,
|
||||
certs: newRepoCerts(cfg),
|
||||
config: newConfig(cfg),
|
||||
chart: cfg.Chart,
|
||||
release: cfg.Release,
|
||||
chartVersion: cfg.ChartVersion,
|
||||
dryRun: cfg.DryRun,
|
||||
wait: cfg.Wait,
|
||||
values: cfg.Values,
|
||||
stringValues: cfg.StringValues,
|
||||
valuesFiles: cfg.ValuesFiles,
|
||||
reuseValues: cfg.ReuseValues,
|
||||
timeout: cfg.Timeout,
|
||||
force: cfg.Force,
|
||||
atomic: cfg.AtomicUpgrade,
|
||||
cleanupOnFail: cfg.CleanupOnFail,
|
||||
certs: newRepoCerts(cfg),
|
||||
createNamespace: cfg.CreateNamespace,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +97,9 @@ func (u *Upgrade) Prepare() error {
|
||||
if u.stringValues != "" {
|
||||
args = append(args, "--set-string", u.stringValues)
|
||||
}
|
||||
if u.createNamespace {
|
||||
args = append(args, "--create-namespace")
|
||||
}
|
||||
for _, vFile := range u.valuesFiles {
|
||||
args = append(args, "--values", vFile)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user