mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-09 05:06:38 +10:00
Use helm settings to define CLI flags for install command
Signed-off-by: joshvanl <vleeuwenjoshua@gmail.com>
This commit is contained in:
@@ -9,7 +9,6 @@ go_library(
|
||||
importpath = "github.com/jetstack/cert-manager/cmd/ctl/pkg/install",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//cmd/ctl/pkg/factory:go_default_library",
|
||||
"//cmd/ctl/pkg/install/helm:go_default_library",
|
||||
"@com_github_spf13_cobra//:go_default_library",
|
||||
"@com_github_spf13_pflag//:go_default_library",
|
||||
|
||||
@@ -35,7 +35,6 @@ import (
|
||||
"helm.sh/helm/v3/pkg/release"
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
|
||||
"github.com/jetstack/cert-manager/cmd/ctl/pkg/factory"
|
||||
"github.com/jetstack/cert-manager/cmd/ctl/pkg/install/helm"
|
||||
)
|
||||
|
||||
@@ -50,7 +49,6 @@ type InstallOptions struct {
|
||||
Wait bool
|
||||
|
||||
genericclioptions.IOStreams
|
||||
*factory.Factory
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -114,6 +112,9 @@ func NewCmdInstall(ctx context.Context, ioStreams genericclioptions.IOStreams) *
|
||||
SilenceErrors: true,
|
||||
}
|
||||
|
||||
settings.AddFlags(cmd.Flags())
|
||||
cmd.Flag("namespace").DefValue = defaultCertManagerNamespace
|
||||
|
||||
addInstallUninstallFlags(cmd.Flags(), &options.client.Timeout, &options.Wait)
|
||||
|
||||
addInstallFlags(cmd.Flags(), options.client)
|
||||
@@ -126,10 +127,6 @@ func NewCmdInstall(ctx context.Context, ioStreams genericclioptions.IOStreams) *
|
||||
cmd.Flags().MarkHidden("chart-name")
|
||||
cmd.Flags().BoolVar(&options.DryRun, "dry-run", false, "Simulate install and output manifest")
|
||||
|
||||
options.Factory = factory.New(cmd)
|
||||
// Set default namespace cli flag value
|
||||
cmd.Flag("namespace").DefValue = defaultCertManagerNamespace
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user