Add --kubeconfig flag (#1381)

add kubeconfig flag

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
This commit is contained in:
Tim Ramlot
2024-03-01 20:26:54 +08:00
committed by GitHub
parent 7ccacb7ee5
commit 5910ce0b99
8 changed files with 105 additions and 81 deletions
+7
View File
@@ -37,6 +37,8 @@ type GlobalOptions struct {
DisableForceUpdate bool
// Quiet is true if the output should be quiet.
Quiet bool
// Kubeconfig is the path to the kubeconfig file to use.
Kubeconfig string
// KubeContext is the name of the kubectl context to use.
KubeContext string
// Debug is true if the output should be verbose.
@@ -104,6 +106,11 @@ func (g *GlobalImpl) KustomizeBinary() string {
return g.GlobalOptions.KustomizeBinary
}
// Kubeconfig returns the path to the kubeconfig file to use.
func (g *GlobalImpl) Kubeconfig() string {
return g.GlobalOptions.Kubeconfig
}
// KubeContext returns the name of the kubectl context to use.
func (g *GlobalImpl) KubeContext() string {
return g.GlobalOptions.KubeContext