config

package
v0.20.0-beta.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DirName  = ".vcluster"
	FileName = "config.json"

	ManagerHelm     ManagerType = "helm"
	ManagerPlatform ManagerType = "platform"
)

Variables

This section is empty.

Functions

func DefaultFilePath

func DefaultFilePath() (string, error)

func PrintManagerInfo

func PrintManagerInfo(verb string, manager ManagerType, log log.Logger)

func Write

func Write(path string, c *CLI) error

Write writes the config content to the provided path.

Types

type CLI

type CLI struct {
	Manager         Manager `json:"manager,omitempty"`
	PreviousContext string  `json:"previousContext,omitempty"`

	Platform          Platform `json:"platform,omitempty"`
	TelemetryDisabled bool     `json:"telemetryDisabled,omitempty"`
	// contains filtered or unexported fields
}

func New

func New() *CLI

New creates a new default config

func Read

func Read(path string, log log.Logger) *CLI

Read returns the current config by trying to read it from the given config path. It returns a new default config if there have been any errors during the read.

func (*CLI) Save

func (c *CLI) Save() error

type Manager

type Manager struct {
	// Type is the current manager type that is used, either helm or platform
	Type ManagerType `json:"type,omitempty"`
}

type ManagerType

type ManagerType string

func ParseManagerType

func ParseManagerType(manager string) (ManagerType, error)

type Platform

type Platform struct {
	metav1.TypeMeta `json:",inline"`

	// VirtualClusterAccessPointCertificates is a map of cached certificates for "access point" mode virtual clusters
	VirtualClusterAccessPointCertificates map[string]VirtualClusterCertificatesEntry `json:"virtualClusterAccessPointCertificates,omitempty"`
	// Host is the https endpoint of how to access loft
	Host string `json:"host,omitempty"`
	// LastInstallContext is the last install context
	LastInstallContext string `json:"lastInstallContext,omitempty"`
	// AccessKey is the access key for the given loft host
	AccessKey string `json:"accesskey,omitempty"`
	// VirtualClusterAccessKey is the access key for the given loft host to create virtual clusters
	VirtualClusterAccessKey string `json:"virtualClusterAccessKey,omitempty"`
	// Insecure specifies if the loft instance is insecure
	Insecure bool `json:"insecure,omitempty"`
}

type VirtualClusterCertificatesEntry

type VirtualClusterCertificatesEntry struct {
	LastRequested   metav1.Time `json:"lastRequested,omitempty"`
	ExpirationTime  time.Time   `json:"expirationTime,omitempty"`
	CertificateData string      `json:"certificateData,omitempty"`
	KeyData         string      `json:"keyData,omitempty"`
}

Jump to

Keyboard shortcuts

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