config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterDomainDefault         = ".local.oss-acorn.io"
	InternalClusterDomainDefault = "svc.cluster.local"

	AcornDNSEndpointDefault = "https://oss-dns.acrn.io/v1"
	AcornDNSStateDefault    = "auto"

	// LetsEncryptOptionDefault is the default state for the Let's Encrypt integration
	LetsEncryptOptionDefault = "disabled"

	// DefaultImageCheckIntervalDefault is the default value for the DefaultImageCheckInterval field
	DefaultImageCheckIntervalDefault = "5m"

	// Default HttpEndpointPattern set to enable Let's Encrypt
	DefaultHttpEndpointPattern = "{{hashConcat 8 .Container .App .Namespace | truncate}}.{{.ClusterDomain}}"

	// Features
	FeatureImageAllowRules = "image-allow-rules"
	FeatureDefaults        = map[string]bool{
		FeatureImageAllowRules: false,
	}
)

Functions

func AsConfigMap

func AsConfigMap(cfg *apiv1.Config) (*corev1.ConfigMap, error)

func CLIConfigFile added in v0.5.0

func CLIConfigFile() (string, error)

func Get

func Get(ctx context.Context, getter kclient.Reader) (*apiv1.Config, error)

func Incomplete

func Incomplete(ctx context.Context, getter kclient.Reader) (*apiv1.Config, error)

func Init

func Init(ctx context.Context, client kclient.Client) error

func IsDockerDesktop

func IsDockerDesktop(ctx context.Context, getter kclient.Reader) (bool, error)

func KubeconfigDir added in v0.5.0

func KubeconfigDir() (string, error)

func RemoveServer added in v0.5.0

func RemoveServer(cfg *CLIConfig, serverAddress string) error

func Set

func Set(ctx context.Context, client kclient.Client, cfg *apiv1.Config) error

func TestSetGet added in v0.5.0

func TestSetGet(ctx context.Context, client kclient.Client, cfg *apiv1.Config) (*apiv1.Config, error)

TestSetGet will do everything that Set does, but instead of persisting the resulting config it will return the merged and completed config. This is as though you did Set() followed by Get() except that the state in Kubernetes will not actually change.

func UnmarshalAndComplete added in v0.6.0

func UnmarshalAndComplete(ctx context.Context, cm *corev1.ConfigMap, getter kclient.Reader) (*apiv1.Config, error)

Types

type AuthConfig added in v0.5.0

type AuthConfig types.AuthConfig

func (AuthConfig) MarshalJSON added in v0.5.0

func (a AuthConfig) MarshalJSON() ([]byte, error)

func (*AuthConfig) UnmarshalJSON added in v0.5.0

func (a *AuthConfig) UnmarshalJSON(data []byte) error

type CLIConfig added in v0.5.0

type CLIConfig struct {
	Auths             map[string]AuthConfig `json:"auths,omitempty"`
	CredentialsStore  string                `json:"credsStore,omitempty"`
	CredentialHelpers map[string]string     `json:"credHelpers,omitempty"`
	HubServers        []string              `json:"hubServers,omitempty"`
	Kubeconfigs       map[string]string     `json:"-"`
	ProjectAliases    map[string]string     `json:"projectAliases,omitempty"`
	CurrentProject    string                `json:"currentProject,omitempty"`

	// TestProjectURLs is used for testing to return EndpointURLs for remote projects
	TestProjectURLs map[string]string `json:"-"`
	// contains filtered or unexported fields
}

func ReadCLIConfig added in v0.5.0

func ReadCLIConfig() (*CLIConfig, error)

func (*CLIConfig) GetAuthConfigs added in v0.5.0

func (c *CLIConfig) GetAuthConfigs() map[string]types.AuthConfig

func (*CLIConfig) GetFilename added in v0.5.0

func (c *CLIConfig) GetFilename() string

func (*CLIConfig) Sanitize added in v0.5.0

func (c *CLIConfig) Sanitize() *CLIConfig

func (*CLIConfig) Save added in v0.5.0

func (c *CLIConfig) Save() error

Jump to

Keyboard shortcuts

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