config

package
v0.0.0-...-9aeb1fa Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Separator      = "="
	SetCommandName = "set"
	FieldNameTag   = "yaml"
	ReadonlyTag    = "readonly"
)
View Source
const (
	KubesharkResourcesNamespaceConfigName = "kubeshark-resources-namespace"
	ConfigFilePathCommandName             = "config-path"
	KubeConfigPathConfigName              = "kube-config-path"
)
View Source
const (
	ApiServerRetries    = "API_SERVER_RETRIES"
	ApiServerTimeoutSec = "API_SERVER_TIMEOUT_SEC"
)

Variables

View Source
var (
	Config = ConfigStruct{}
)

Functions

func GetIntEnvConfig

func GetIntEnvConfig(key string, defaultValue int) int

func InitConfig

func InitConfig(cmd *cobra.Command) error

func WriteConfig

func WriteConfig(config *ConfigStruct) error

Types

type ConfigStruct

type ConfigStruct struct {
	Hub                         HubConfig                   `yaml:"hub"`
	Front                       FrontConfig                 `yaml:"front"`
	Tap                         configStructs.TapConfig     `yaml:"tap"`
	Check                       configStructs.CheckConfig   `yaml:"check"`
	Install                     configStructs.InstallConfig `yaml:"install"`
	Version                     configStructs.VersionConfig `yaml:"version"`
	View                        configStructs.ViewConfig    `yaml:"view"`
	Logs                        configStructs.LogsConfig    `yaml:"logs"`
	Config                      configStructs.ConfigConfig  `yaml:"config,omitempty"`
	AgentImage                  string                      `yaml:"agent-image,omitempty" readonly:""`
	ImagePullPolicyStr          string                      `yaml:"image-pull-policy" default:"Always"`
	KubesharkResourcesNamespace string                      `yaml:"kubeshark-resources-namespace" default:"kubeshark"`
	DumpLogs                    bool                        `yaml:"dump-logs" default:"false"`
	KubeConfigPathStr           string                      `yaml:"kube-config-path"`
	KubeContext                 string                      `yaml:"kube-context"`
	ConfigFilePath              string                      `yaml:"config-path,omitempty" readonly:""`
	HeadlessMode                bool                        `yaml:"headless" default:"false"`
	LogLevelStr                 string                      `yaml:"log-level,omitempty" default:"INFO" readonly:""`
	ServiceMap                  bool                        `yaml:"service-map" default:"true"`
	OAS                         shared.OASConfig            `yaml:"oas"`
}

func CreateDefaultConfig

func CreateDefaultConfig() ConfigStruct

func GetConfigWithDefaults

func GetConfigWithDefaults() (*ConfigStruct, error)

func (*ConfigStruct) ImagePullPolicy

func (config *ConfigStruct) ImagePullPolicy() v1.PullPolicy

func (*ConfigStruct) IsNsRestrictedMode

func (config *ConfigStruct) IsNsRestrictedMode() bool

func (*ConfigStruct) KubeConfigPath

func (config *ConfigStruct) KubeConfigPath() string

func (*ConfigStruct) LogLevel

func (config *ConfigStruct) LogLevel() logging.Level

func (*ConfigStruct) SetDefaults

func (config *ConfigStruct) SetDefaults()

type FrontConfig

type FrontConfig struct {
	PortForward PortForward `yaml:"port-forward"`
}

type HubConfig

type HubConfig struct {
	PortForward PortForward `yaml:"port-forward"`
}

type PortForward

type PortForward struct {
	SrcPort uint16 `yaml:"src-port"`
	DstPort uint16 `yaml:"dst-port"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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