config

package
v0.6.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCLIConfig

func DeleteCLIConfig() error

DeleteCLIConfig deletes the Kargo CLI configuration file from the Kargo home directory.

func IsConfigNotFoundErr added in v0.3.1

func IsConfigNotFoundErr(target error) bool

func NewConfigNotFoundErr

func NewConfigNotFoundErr(path string) error

func SaveCLIConfig

func SaveCLIConfig(config CLIConfig) error

SaveCLIConfig saves Kargo CLI configuration to a file in the Kargo home directory.

Types

type CLIConfig

type CLIConfig struct {
	// APIAddress is the address of the Kargo API server.
	APIAddress string `json:"apiAddress,omitempty"`
	// BearerToken is used to authenticate with the Kargo API server. This could
	// be any of the following:
	//   1. An identity token issued by an OIDC identity provider
	//   2. An identity token issued by the Kargo API server itself
	//   3. An opaque token for the Kubernetes API server that the Kargo API
	//      server will communicate with
	// This token will be sent in the Authorization header of all requests to the
	// Kargo API server. The Kargo API server will ascertain which of the three
	// cases above applies and will act accordingly.
	BearerToken string `json:"bearerToken,omitempty"`
	// RefreshToken, if set, is used to refresh the Token, which must, in such a
	// case, have been issued by an OIDC identity provider.
	RefreshToken string `json:"refreshToken,omitempty"`
	// InsecureSkipTLSVerify indicates whether the user indicated during login
	// that certificate warnings should be ignored. When true, this option will be
	// applied to all subsequent Kargo commands until the user logs out or
	// re-authenticates. When true, refresh tokens will not be used, thereby
	// forcing users to periodically re-assess this choice.
	InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`
	// Project is the default Project for the command.
	Project string `json:"project,omitempty"`
}

CLIConfig represents CLI configuration.

func LoadCLIConfig

func LoadCLIConfig() (CLIConfig, error)

LoadCLIConfig loads Kargo CLI configuration from a file in the Kargo home directory.

func MaskedConfig added in v0.5.0

func MaskedConfig(config CLIConfig) CLIConfig

func NewDefaultCLIConfig added in v0.3.1

func NewDefaultCLIConfig() CLIConfig

NewDefaultCLIConfig returns a new default CLI configuration.

type ErrConfigNotFound

type ErrConfigNotFound struct {
	Path string
}

func (*ErrConfigNotFound) Error

func (e *ErrConfigNotFound) Error() string

Jump to

Keyboard shortcuts

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