config

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 15 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadConfigFile             = readConfigFileCached
	GetConfigForCurrentKubectx = getConfigForCurrentKubectx
)
View Source
var RunModes = struct {
	Build    RunMode
	Dev      RunMode
	Debug    RunMode
	Run      RunMode
	Deploy   RunMode
	Render   RunMode
	Delete   RunMode
	Diagnose RunMode
}{
	Build:    "build",
	Dev:      "dev",
	Debug:    "debug",
	Run:      "run",
	Deploy:   "deploy",
	Render:   "render",
	Delete:   "delete",
	Diagnose: "diagnose",
}

Functions

func GetDebugHelpersRegistry added in v1.7.1

func GetDebugHelpersRegistry(configFile string) (string, error)

func GetDefaultRepo added in v0.36.0

func GetDefaultRepo(configFile string, cliValue *string) (string, error)

func GetInsecureRegistries added in v0.36.0

func GetInsecureRegistries(configFile string) ([]string, error)

func IsK3dCluster added in v1.7.1

func IsK3dCluster(kubeContext string) bool

IsK3dCluster checks that the given `kubeContext` is talking to `k3d`.

func IsKindCluster added in v0.36.0

func IsKindCluster(kubeContext string) bool

IsKindCluster checks that the given `kubeContext` is talking to `kind`.

func IsUpdateCheckEnabled added in v0.37.1

func IsUpdateCheckEnabled(configfile string) bool

func K3dClusterName added in v1.7.1

func K3dClusterName(clusterName string) string

K3dClusterName returns the internal name of a k3d cluster.

func KindClusterName added in v1.7.1

func KindClusterName(clusterName string) string

KindClusterName returns the internal kind name of a kubernetes cluster.

func ResolveConfigFile added in v0.36.0

func ResolveConfigFile(configFile string) (string, error)

ResolveConfigFile determines the default config location, if the configFile argument is empty.

func ShouldDisplayPrompt added in v1.3.1

func ShouldDisplayPrompt(configfile string) bool

func UpdateGlobalCollectMetrics added in v1.19.0

func UpdateGlobalCollectMetrics(configFile string, collectMetrics bool) error

func UpdateGlobalSurveyPrompted added in v1.7.1

func UpdateGlobalSurveyPrompted(configFile string) error

func UpdateGlobalSurveyTaken added in v1.7.1

func UpdateGlobalSurveyTaken(configFile string) error

func WriteFullConfig added in v1.7.1

func WriteFullConfig(configFile string, cfg *GlobalConfig) error

Types

type Cluster added in v1.7.1

type Cluster struct {
	Local      bool
	PushImages bool
	LoadImages bool
}

func GetCluster added in v1.7.1

func GetCluster(configFile string, minikubeProfile string, detectMinikube bool) (Cluster, error)

type ContextConfig added in v0.36.0

type ContextConfig struct {
	Kubecontext        string   `yaml:"kube-context,omitempty"`
	DefaultRepo        string   `yaml:"default-repo,omitempty"`
	LocalCluster       *bool    `yaml:"local-cluster,omitempty"`
	InsecureRegistries []string `yaml:"insecure-registries,omitempty"`
	// DebugHelpersRegistry is the registry from which the debug helper images are used.
	DebugHelpersRegistry string        `yaml:"debug-helpers-registry,omitempty"`
	UpdateCheck          *bool         `yaml:"update-check,omitempty"`
	Survey               *SurveyConfig `yaml:"survey,omitempty"`
	KindDisableLoad      *bool         `yaml:"kind-disable-load,omitempty"`
	K3dDisableLoad       *bool         `yaml:"k3d-disable-load,omitempty"`
	CollectMetrics       *bool         `yaml:"collect-metrics,omitempty"`
}

ContextConfig is the context-specific config information provided in the global Skaffold config.

type GlobalConfig added in v0.36.0

type GlobalConfig struct {
	Global         *ContextConfig   `yaml:"global,omitempty"`
	ContextConfigs []*ContextConfig `yaml:"kubeContexts"`
}

GlobalConfig is the top level struct for the global Skaffold config It is unrelated to the SkaffoldConfig object (parsed from the skaffold.yaml)

func ReadConfigFileNoCache added in v0.36.0

func ReadConfigFileNoCache(configFile string) (*GlobalConfig, error)

ReadConfigFileNoCache reads the given config yaml file and unmarshals the contents. Only visible for testing, use ReadConfigFile instead.

type Muted added in v1.7.1

type Muted struct {
	Phases []string
}

Muted lists phases for which logs are muted.

func (Muted) MuteBuild added in v1.7.1

func (m Muted) MuteBuild() bool

func (Muted) MuteDeploy added in v1.7.1

func (m Muted) MuteDeploy() bool

func (Muted) MuteStatusCheck added in v1.7.1

func (m Muted) MuteStatusCheck() bool

func (Muted) MuteTest added in v1.7.1

func (m Muted) MuteTest() bool

type PortForwardOptions added in v0.33.0

type PortForwardOptions struct {
	Enabled     bool
	ForwardPods bool
}

PortForwardOptions are options set by the command line for port forwarding with additional configuration information as well

type RunMode added in v1.7.1

type RunMode string

type SkaffoldOptions

type SkaffoldOptions struct {
	ConfigurationFile     string
	ConfigurationFilter   []string
	GlobalConfig          string
	EventLogFile          string
	Cleanup               bool
	Notification          bool
	Tail                  bool
	SkipTests             bool
	CacheArtifacts        bool
	EnableRPC             bool
	Force                 bool
	NoPrune               bool
	NoPruneChildren       bool
	StatusCheck           bool
	AutoBuild             bool
	AutoSync              bool
	AutoDeploy            bool
	RenderOnly            bool
	AutoCreateConfig      bool
	AssumeYes             bool
	RenderOutput          string
	ProfileAutoActivation bool
	DryRun                bool
	SkipRender            bool

	// Add Skaffold-specific labels including runID, deployer labels, etc.
	// `CustomLabels` are still applied if this is false. Must only be used in
	// commands which don't deploy (e.g. `skaffold render`) since the runID
	// label isn't available.
	AddSkaffoldLabels bool
	DetectMinikube    bool

	PortForward        PortForwardOptions
	CustomTag          string
	Namespace          string
	CacheFile          string
	Trigger            string
	KubeContext        string
	KubeConfig         string
	DigestSource       string
	WatchPollInterval  int
	DefaultRepo        StringOrUndefined
	CustomLabels       []string
	TargetImages       []string
	Profiles           []string
	InsecureRegistries []string
	Muted              Muted
	Command            string
	RPCPort            int
	RPCHTTPPort        int

	// TODO(https://github.com/GoogleContainerTools/skaffold/issues/3668):
	// remove minikubeProfile from here and instead detect it by matching the
	// kubecontext API Server to minikube profiles
	MinikubeProfile  string
	RepoCacheDir     string
	WaitForDeletions WaitForDeletions
}

SkaffoldOptions are options that are set by command line arguments not included in the config file itself

func (*SkaffoldOptions) IsTargetImage added in v0.30.0

func (opts *SkaffoldOptions) IsTargetImage(artifact *latest.Artifact) bool

func (*SkaffoldOptions) Mode added in v1.7.1

func (opts *SkaffoldOptions) Mode() RunMode

func (*SkaffoldOptions) Prune added in v0.27.0

func (opts *SkaffoldOptions) Prune() bool

Prune returns true iff the user did NOT specify the --no-prune flag, and the user did NOT specify the --cache-artifacts flag.

type StringOrUndefined added in v1.7.1

type StringOrUndefined struct {
	// contains filtered or unexported fields
}

StringOrUndefined holds the value of a flag of type `string`, that's by default `undefined`. We use this instead of just `string` to differentiate `undefined` and `empty string` values.

func (*StringOrUndefined) Set added in v1.7.1

func (s *StringOrUndefined) Set(v string) error

func (*StringOrUndefined) String added in v1.7.1

func (s *StringOrUndefined) String() string

func (*StringOrUndefined) Type added in v1.7.1

func (s *StringOrUndefined) Type() string

func (*StringOrUndefined) Value added in v1.7.1

func (s *StringOrUndefined) Value() *string

type SurveyConfig added in v1.3.1

type SurveyConfig struct {
	DisablePrompt *bool  `yaml:"disable-prompt,omitempty"`
	LastTaken     string `yaml:"last-taken,omitempty"`
	LastPrompted  string `yaml:"last-prompted,omitempty"`
}

SurveyConfig is the survey config information

type WaitForDeletions added in v1.7.1

type WaitForDeletions struct {
	Max     time.Duration
	Delay   time.Duration
	Enabled bool
}

WaitForDeletions configures the wait for pending deletions.

Jump to

Keyboard shortcuts

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