settings

package
v0.0.2-pre Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdditionalCASettingName         = "additional-ca"
	BackupTargetSettingName         = "backup-target"
	VMForceResetPolicySettingName   = "vm-force-reset-policy"
	SupportBundleTimeoutSettingName = "support-bundle-timeout"
	HttpProxySettingName            = "http-proxy"
	OvercommitConfigSettingName     = "overcommit-config"
	SSLCertificatesSettingName      = "ssl-certificates"
	SSLParametersName               = "ssl-parameters"
	VipPoolsConfigSettingName       = "vip-pools"
	VolumeSnapshotClassSettingName  = "volume-snapshot-class"
	DefaultDashboardUIURL           = "https://releases.rancher.com/harvester-ui/dashboard/latest/index.html"
	SupportBundleImageName          = "support-bundle-image"
	CSIDriverConfigSettingName      = "csi-driver-config"
)

Variables

View Source
var (
	InjectDefaults string

	AdditionalCA            = NewSetting(AdditionalCASettingName, "")
	APIUIVersion            = NewSetting("api-ui-version", "1.1.9") // Please update the HARVESTER_API_UI_VERSION in package/Dockerfile when updating the version here.
	ClusterRegistrationURL  = NewSetting("cluster-registration-url", "")
	ServerVersion           = NewSetting("server-version", "dev")
	UIIndex                 = NewSetting("ui-index", DefaultDashboardUIURL)
	UIPath                  = NewSetting("ui-path", "/usr/share/harvester/harvester")
	UISource                = NewSetting("ui-source", "auto") // Options are 'auto', 'external' or 'bundled'
	VolumeSnapshotClass     = NewSetting(VolumeSnapshotClassSettingName, "longhorn")
	BackupTargetSet         = NewSetting(BackupTargetSettingName, InitBackupTargetToString())
	UpgradableVersions      = NewSetting("upgradable-versions", "")
	UpgradeCheckerEnabled   = NewSetting("upgrade-checker-enabled", "true")
	UpgradeCheckerURL       = NewSetting("upgrade-checker-url", "https://harvester-upgrade-responder.rancher.io/v1/checkupgrade")
	ReleaseDownloadURL      = NewSetting("release-download-url", "https://releases.rancher.com/harvester")
	LogLevel                = NewSetting("log-level", "info") // options are info, debug and trace
	SSLCertificates         = NewSetting(SSLCertificatesSettingName, "{}")
	SSLParameters           = NewSetting(SSLParametersName, "{}")
	SupportBundleImage      = NewSetting(SupportBundleImageName, "{}")
	SupportBundleNamespaces = NewSetting("support-bundle-namespaces", "")
	SupportBundleTimeout    = NewSetting(SupportBundleTimeoutSettingName, "10") // Unit is minute. 0 means disable timeout.
	DefaultStorageClass     = NewSetting("default-storage-class", "longhorn")
	HTTPProxy               = NewSetting(HttpProxySettingName, "{}")
	VMForceResetPolicySet   = NewSetting(VMForceResetPolicySettingName, InitVMForceResetPolicy())
	OvercommitConfig        = NewSetting(OvercommitConfigSettingName, `{"cpu":1600,"memory":150,"storage":200}`)
	VipPools                = NewSetting(VipPoolsConfigSettingName, "")
	AutoDiskProvisionPaths  = NewSetting("auto-disk-provision-paths", "")
	CSIDriverConfig         = NewSetting(CSIDriverConfigSettingName, `{"driver.longhorn.io":{"volumeSnapshotClassName":"longhorn-snapshot","backupVolumeSnapshotClassName":"longhorn"}}`)
)

Functions

func GetEnvKey

func GetEnvKey(key string) string

func InitBackupTargetToString

func InitBackupTargetToString() string

func InitVMForceResetPolicy

func InitVMForceResetPolicy() string

func IsRelease

func IsRelease() bool

func SetProvider

func SetProvider(p Provider) error

Types

type BackupTarget

type BackupTarget struct {
	Type               TargetType `json:"type"`
	Endpoint           string     `json:"endpoint"`
	AccessKeyID        string     `json:"accessKeyId"`
	SecretAccessKey    string     `json:"secretAccessKey"`
	BucketName         string     `json:"bucketName"`
	BucketRegion       string     `json:"bucketRegion"`
	Cert               string     `json:"cert"`
	VirtualHostedStyle bool       `json:"virtualHostedStyle"`
}

func DecodeBackupTarget

func DecodeBackupTarget(value string) (*BackupTarget, error)

func (*BackupTarget) IsDefaultBackupTarget

func (target *BackupTarget) IsDefaultBackupTarget() bool

type CSIDriverInfo

type CSIDriverInfo struct {
	VolumeSnapshotClassName       string `json:"volumeSnapshotClassName"`
	BackupVolumeSnapshotClassName string `json:"backupVolumeSnapshotClassName"`
}

type Image

type Image struct {
	Repository      string            `json:"repository"`
	Tag             string            `json:"tag"`
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`
}

type Overcommit

type Overcommit struct {
	Cpu     int `json:"cpu"`
	Memory  int `json:"memory"`
	Storage int `json:"storage"`
}

type Provider

type Provider interface {
	Get(name string) string
	Set(name, value string) error
	SetIfUnset(name, value string) error
	SetAll(settings map[string]Setting) error
}

type SSLCertificate

type SSLCertificate struct {
	CA                string `json:"ca"`
	PublicCertificate string `json:"publicCertificate"`
	PrivateKey        string `json:"privateKey"`
}

type SSLParameter

type SSLParameter struct {
	Protocols string `json:"protocols"`
	Ciphers   string `json:"ciphers"`
}

type Setting

type Setting struct {
	Name     string
	Default  string
	ReadOnly bool
}

func NewSetting

func NewSetting(name, def string) Setting

func (Setting) Get

func (s Setting) Get() string

func (Setting) GetInt

func (s Setting) GetInt() int

func (Setting) Set

func (s Setting) Set(value string) error

func (Setting) SetIfUnset

func (s Setting) SetIfUnset(value string) error

type TargetType

type TargetType string
const (
	S3BackupType  TargetType = "s3"
	NFSBackupType TargetType = "nfs"
)

type VMForceResetPolicy

type VMForceResetPolicy struct {
	Enable bool `json:"enable"`
	// Period means how many seconds to wait for a node get back.
	Period int64 `json:"period"`
}

func DecodeVMForceResetPolicy

func DecodeVMForceResetPolicy(value string) (*VMForceResetPolicy, error)

Jump to

Keyboard shortcuts

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