config

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReadConfigFile             = readConfigFileCached
	GetConfigForCurrentKubectx = getConfigForCurrentKubectx
	DiscoverLocalRegistry      = discoverLocalRegistry
)
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

func GetDebugHelpersRegistry(configFile string) (string, error)

func GetDefaultRepo

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

func GetInsecureRegistries

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

func GetMultiLevelRepo

func GetMultiLevelRepo(configFile string) (*bool, error)

func GetRemoteCacheDir added in v2.8.0

func GetRemoteCacheDir(opts SkaffoldOptions) (string, error)

GetRemoteCacheDir returns the directory for the remote cache.

func IsK3dCluster

func IsK3dCluster(kubeContext string) bool

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

func IsKindCluster

func IsKindCluster(kubeContext string) bool

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

func IsMixedPlatformCluster

func IsMixedPlatformCluster(ctx context.Context, kubeContext string) bool

func IsUpdateCheckEnabled

func IsUpdateCheckEnabled(configfile string) bool

func IsUpdateCheckEnabledForContext

func IsUpdateCheckEnabledForContext(cfg *ContextConfig) bool

func K3dClusterName

func K3dClusterName(clusterName string) string

K3dClusterName returns the internal name of a k3d cluster.

func KindClusterName

func KindClusterName(clusterName string) string

KindClusterName returns the internal kind name of a kubernetes cluster.

func ResolveConfigFile

func ResolveConfigFile(configFile string) (string, error)

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

func ShouldDisplayUpdateMsg

func ShouldDisplayUpdateMsg(configfile string) bool

func UpdateGlobalCollectMetrics

func UpdateGlobalCollectMetrics(configFile string, collectMetrics bool) error

func UpdateGlobalSurveyPrompted

func UpdateGlobalSurveyPrompted(configFile string) error

func UpdateHaTSSurveyTaken

func UpdateHaTSSurveyTaken(configFile string) error

func UpdateMsgDisplayed

func UpdateMsgDisplayed(configFile string) error

UpdateMsgDisplayed updates the `last-prompted` config for `update-config` in the skaffold config

func UpdateUserSurveyTaken

func UpdateUserSurveyTaken(configFile string, id string) error

func WriteFullConfig

func WriteFullConfig(configFile string, cfg *GlobalConfig) error

Types

type BoolOrUndefined

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

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

func NewBoolOrUndefined

func NewBoolOrUndefined(v *bool) BoolOrUndefined

func (*BoolOrUndefined) Set

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

func (*BoolOrUndefined) SetNil

func (s *BoolOrUndefined) SetNil() error

func (*BoolOrUndefined) String

func (s *BoolOrUndefined) String() string

func (*BoolOrUndefined) Type

func (s *BoolOrUndefined) Type() string

func (*BoolOrUndefined) Value

func (s *BoolOrUndefined) Value() *bool

type Cluster

type Cluster struct {
	Local           bool
	PushImages      bool
	LoadImages      bool
	IsMixedPlatform bool
	DefaultRepo     StringOrUndefined
}

func GetCluster

func GetCluster(ctx context.Context, opts GetClusterOpts) (Cluster, error)

type ContextConfig

type ContextConfig struct {
	Kubecontext        string   `yaml:"kube-context,omitempty"`
	DefaultRepo        string   `yaml:"default-repo,omitempty"`
	MultiLevelRepo     *bool    `yaml:"multi-level-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"`
	UpdateCheckConfig    *UpdateConfig `yaml:"update,omitempty"`
}

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

type GetClusterOpts

type GetClusterOpts struct {
	ConfigFile      string
	DefaultRepo     StringOrUndefined
	MinikubeProfile string
	DetectMinikube  bool
}

type GlobalConfig

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

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 IntOrUndefined

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

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

func NewIntOrUndefined

func NewIntOrUndefined(v *int) IntOrUndefined

func (*IntOrUndefined) Set

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

func (*IntOrUndefined) SetNil

func (s *IntOrUndefined) SetNil() error

func (*IntOrUndefined) String

func (s *IntOrUndefined) String() string

func (*IntOrUndefined) Type

func (s *IntOrUndefined) Type() string

func (*IntOrUndefined) Value

func (s *IntOrUndefined) Value() *int

type Muted

type Muted struct {
	Phases []string
}

Muted lists phases for which logs are muted.

func (Muted) MuteBuild

func (m Muted) MuteBuild() bool

func (Muted) MuteDeploy

func (m Muted) MuteDeploy() bool

func (Muted) MuteRender

func (m Muted) MuteRender() bool

func (Muted) MuteStatusCheck

func (m Muted) MuteStatusCheck() bool

func (Muted) MuteTest

func (m Muted) MuteTest() bool

type PortForwardOptions

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

PortForwardOptions are options set by the command line for port forwarding. `off` is intended to be a single standalone option.

func (*PortForwardOptions) Append

func (p *PortForwardOptions) Append(o string) error

func (PortForwardOptions) Enabled

func (p PortForwardOptions) Enabled() bool

Enabled checks if the port-forwarding options indicates that forwarding should be enabled.

func (PortForwardOptions) Equal

Equal checks that two options are the same; this method exists primarily for tests.

func (PortForwardOptions) ForwardDebug

func (p PortForwardOptions) ForwardDebug(runMode RunMode) bool

func (PortForwardOptions) ForwardPods

func (p PortForwardOptions) ForwardPods(runMode RunMode) bool

func (PortForwardOptions) ForwardServices

func (p PortForwardOptions) ForwardServices(runMode RunMode) bool

func (PortForwardOptions) ForwardUser

func (p PortForwardOptions) ForwardUser(runMode RunMode) bool

func (*PortForwardOptions) GetSlice

func (p *PortForwardOptions) GetSlice() []string

func (*PortForwardOptions) Replace

func (p *PortForwardOptions) Replace(options []string) error

func (*PortForwardOptions) Set

func (p *PortForwardOptions) Set(csv string) error

func (*PortForwardOptions) String

func (p *PortForwardOptions) String() string

func (*PortForwardOptions) Type

func (p *PortForwardOptions) Type() string

type RunMode

type RunMode string

type SkaffoldOptions

type SkaffoldOptions struct {
	Apply                       bool
	AutoBuild                   bool
	AutoCreateConfig            bool
	AutoDeploy                  bool
	AutoSync                    bool
	AssumeYes                   bool
	CacheArtifacts              bool
	ContainerDebugging          bool
	Cleanup                     bool
	DetectMinikube              bool
	DryRun                      bool
	EnableRPC                   bool
	Force                       bool
	ForceLoadImages             bool
	IterativeStatusCheck        bool
	FastFailStatusCheck         bool
	KeepRunningOnFailure        bool
	TolerateFailuresStatusCheck bool
	Notification                bool
	NoPrune                     bool
	NoPruneChildren             bool
	ProfileAutoActivation       bool
	PropagateProfiles           bool
	RenderOnly                  bool
	SkipTests                   bool
	SkipConfigDefaults          bool
	Tail                        bool
	WaitForConnection           bool
	AutoInit                    bool
	EnablePlatformNodeAffinity  bool
	EnableGKEARMNodeToleration  bool
	DisableMultiPlatformBuild   bool
	CheckClusterNodePlatforms   bool
	MakePathsAbsolute           *bool
	MultiLevelRepo              *bool
	CloudRunProject             string
	CloudRunLocation            string
	ConfigurationFile           string
	HydrationDir                string
	InventoryNamespace          string
	InventoryID                 string
	InventoryName               string
	GlobalConfig                string
	EventLogFile                string
	RenderOutput                string
	User                        string
	CustomTag                   string
	Namespace                   string
	CacheFile                   string
	Trigger                     string
	KubeContext                 string
	KubeConfig                  string
	LastLogFile                 string
	DigestSource                string
	Command                     string
	MinikubeProfile             string
	RemoteCacheDir              string
	TransformRulesFile          string
	VerifyDockerNetwork         string
	VerifyEnvFile               string
	CustomLabels                []string
	TargetImages                []string
	Profiles                    []string
	InsecureRegistries          []string
	ConfigurationFilter         []string
	HydratedManifests           []string
	Platforms                   []string
	BuildConcurrency            int
	WatchPollInterval           int
	StatusCheck                 BoolOrUndefined
	PushImages                  BoolOrUndefined
	RPCPort                     IntOrUndefined
	RPCHTTPPort                 IntOrUndefined
	Muted                       Muted
	PortForward                 PortForwardOptions
	DefaultRepo                 StringOrUndefined
	SyncRemoteCache             SyncRemoteCacheOption
	WaitForDeletions            WaitForDeletions
	ManifestsOverrides          []string
	ManifestsValueFile          string
	StatusCheckSelectorsFile    string
}

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

func (*SkaffoldOptions) IsTargetImage

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

func (*SkaffoldOptions) Mode

func (opts *SkaffoldOptions) Mode() RunMode

func (*SkaffoldOptions) Prune

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

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 NewStringOrUndefined

func NewStringOrUndefined(v *string) StringOrUndefined

func (StringOrUndefined) Equal

func (*StringOrUndefined) Set

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

func (*StringOrUndefined) SetNil

func (s *StringOrUndefined) SetNil() error

func (*StringOrUndefined) String

func (s *StringOrUndefined) String() string

func (*StringOrUndefined) Type

func (s *StringOrUndefined) Type() string

func (*StringOrUndefined) Value

func (s *StringOrUndefined) Value() *string

type SurveyConfig

type SurveyConfig struct {
	DisablePrompt *bool         `yaml:"disable-prompt,omitempty"`
	LastTaken     string        `yaml:"last-taken,omitempty"`
	LastPrompted  string        `yaml:"last-prompted,omitempty"`
	UserSurveys   []*UserSurvey `yaml:"user-surveys,omitempty"`
}

SurveyConfig is the survey config information

type SyncRemoteCacheOption

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

SyncRemoteCacheOption holds the value of flag `--sync-remote-cache` Valid flag values are `always`(default), `missing`, or `never`.

func (*SyncRemoteCacheOption) CloneDisabled

func (s *SyncRemoteCacheOption) CloneDisabled() bool

CloneDisabled specifies if cloning remote dependencies is disabled by flag value

func (*SyncRemoteCacheOption) FetchDisabled

func (s *SyncRemoteCacheOption) FetchDisabled() bool

FetchDisabled specifies if fetching remote dependencies is disabled by flag value

func (*SyncRemoteCacheOption) Set

func (*SyncRemoteCacheOption) SetNil

func (s *SyncRemoteCacheOption) SetNil() error

func (*SyncRemoteCacheOption) String

func (s *SyncRemoteCacheOption) String() string

func (*SyncRemoteCacheOption) Type

func (s *SyncRemoteCacheOption) Type() string

func (*SyncRemoteCacheOption) Value

func (s *SyncRemoteCacheOption) Value() string

type UpdateConfig

type UpdateConfig struct {
	// TODO (tejaldesai) Move ContextConfig.UpdateCheck config within this struct
	LastPrompted string `yaml:"last-prompted,omitempty"`
}

UpdateConfig is the update config information

type UserSurvey

type UserSurvey struct {
	ID    string `yaml:"id"`
	Taken *bool  `yaml:"taken,omitempty"`
}

type WaitForDeletions

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