Documentation ¶
Index ¶
Constants ¶
const ( DefaultChannelName = "default" DefaultCloudChannelName = "stable/cloud" )
Variables ¶
This section is empty.
Functions ¶
func GetChannel ¶
func GetChannel() string
GetChannel returns the TELEPORT_AUTOMATIC_UPGRADES_CHANNEL value. Example of an acceptable value for TELEPORT_AUTOMATIC_UPGRADES_CHANNEL is: https://updates.releases.teleport.dev/v1/stable/cloud
func GetUpgraderVersion ¶
GetUpgraderVersion returns the teleport upgrader version
func IsEnabled ¶
func IsEnabled() bool
IsEnabled reads the TELEPORT_AUTOMATIC_UPGRADES and returns whether Automatic Upgrades are enabled or disabled. An error is logged (warning) if the variable is present but its value could not be converted into a boolean. Acceptable values for TELEPORT_AUTOMATIC_UPGRADES are: 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False
Types ¶
type Channel ¶
type Channel struct { // ForwardURL is the URL of the upstream version server providing the channel version/criticality. ForwardURL string `yaml:"forward_url,omitempty"` // StaticVersion is a static version the channel must serve. With or without the leading "v". StaticVersion string `yaml:"static_version,omitempty"` // Critical is whether the static version channel should be marked as a critical update. Critical bool `yaml:"critical"` // contains filtered or unexported fields }
Channel describes an automatic update channel configuration. It can be configured to serve a static version, or forward version requests to an upstream version server. Forwarded results are cached for 1 minute.
func NewDefaultChannel ¶
NewDefaultChannel creates a default automatic upgrade channel It looks up the environment variable, and if not found uses the default base URL. This default channel can be used in the proxy (to back its own version server) or in other Teleport process such as integration services deploying and updating teleport agents.
func (*Channel) CheckAndSetDefaults ¶
CheckAndSetDefaults checks that the Channel configuration is valid and inits the version getter and maintenance trigger of the Channel based on its configuration. This function must be called before using the channel.
func (*Channel) GetCritical ¶
GetCritical returns the current criticality of the channel. If io is involved, this function implements cache and is safe to call frequently.
func (*Channel) GetVersion ¶
GetVersion returns the current version of the channel. If io is involved, this function implements cache and is safe to call frequently. If the target version major is higher than the Teleport version (the one in the Teleport binary, this is usually the proxy version), this function returns the Teleport version instead. If the version source intentionally did not specify a version, a NoNewVersionError is returned.
type Channels ¶
Channels is a map of Channel objects.
func (Channels) CheckAndSetDefaults ¶
CheckAndSetDefaults checks that every Channel is valid and initializes them. It also creates default channels if they are not already present. Cloud must have the `default` and `stable/cloud` channels. Self-hosted with automatic upgrades must have the `default` channel.