v0.3.1 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 9 Imported by: 0



Package cli describes the operating environment for the hypper CLI. hypper's environment encapsulates all of the service dependencies hypper has. These dependencies are expressed as interfaces so that alternate implementations (mocks, etc.) can be easily generated. Hypper inherits most of the environment values from helm and expands on top of them



This section is empty.


This section is empty.


This section is empty.


type EnvSettings

type EnvSettings struct {
	EnvSettings *cli.EnvSettings

	// KubeConfig is the path to the kubeconfig file
	KubeConfig string
	// KubeContext is the name of the kubeconfig context.
	KubeContext string
	// Bearer KubeToken used for authentication
	KubeToken string
	// Username to impersonate for the operation
	KubeAsUser string
	// Groups to impersonate for the operation, multiple groups parsed from a comma delimited list
	KubeAsGroups []string
	// Kubernetes API Server Endpoint for authentication
	KubeAPIServer string
	// Custom certificate authority file.
	KubeCaFile string
	// Debug indicates whether or not Helm is running in Debug mode.
	Debug bool
	// RegistryConfig is the path to the registry config file.
	RegistryConfig string
	// RepositoryConfig is the path to the repositories file.
	RepositoryConfig string
	// RepositoryCache is the path to the repository cache directory.
	RepositoryCache string
	// PluginsDirectory is the path to the plugins directory.
	PluginsDirectory string
	// MaxHistory is the max release history maintained.
	MaxHistory int

	// hypper specific
	Verbose           bool
	NoColors          bool
	NoEmojis          bool
	NamespaceFromFlag bool
	// contains filtered or unexported fields

EnvSettings describes all of the environment settings. It contains a pointer to Helm settings for functions that need that exact type We overwrite all of the helm settings values with our own on New so it contains the same config settings

func New

func New() *EnvSettings

New is a constructor of EnvSettings

func NewWithNamespace added in v0.2.0

func NewWithNamespace(ns string) *EnvSettings

NewWithNamespace is a constructor of EnvSettings, that accepts a ns Shouldn't be used outside of tests.

func (*EnvSettings) AddFlags

func (s *EnvSettings) AddFlags(fs *pflag.FlagSet)

AddFlags binds flags to the given flagset.

func (*EnvSettings) EnvVars

func (s *EnvSettings) EnvVars() map[string]string

EnvVars reads the hypper and helm enviromental variables and populates values in the EnvSettings caller.

func (*EnvSettings) FillHelmSettings added in v0.1.0

func (s *EnvSettings) FillHelmSettings()

FillHelmSettings will fill the helm cli.Settings with the proper values from CLI flags This has to be called after the flags are set, otherwise the flags are not propagated to Helm cli.Settings

func (*EnvSettings) Namespace

func (s *EnvSettings) Namespace() string

Namespace gets the namespace from the configuration or the config flag

func (*EnvSettings) RESTClientGetter added in v0.2.0

func (s *EnvSettings) RESTClientGetter() genericclioptions.RESTClientGetter

RESTClientGetter gets the kubeconfig from EnvSettings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL