talos/internal/pkg/meta/constants.go
Andrey Smirnov 9e8603f53b
feat: implement new download URL variable ${code}
New variable value is coming from `META`, and it might be set using the
interactive console (not implemented yet, but it will come soon).

I had to refactor the URL expansion implementation:

* simplify things where possible
* provide more unit-tests for smaller units
* handle expansion of all variables in parallel
* allow parallel expansion on multiple variables

Also I refactored download code to support proper passing of endpoint
function with context.

The end result:

* Talos will try to download config for 3 hours before rebooting
* Each attempt which includes URL expansion + download is limited to 3
  minutes

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2023-03-24 21:49:36 +04:00

27 lines
1.0 KiB
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package meta
const (
// Upgrade is the upgrade tag.
Upgrade = iota + 6
// StagedUpgradeImageRef stores image reference for staged upgrade.
StagedUpgradeImageRef
// StagedUpgradeInstallOptions stores JSON-serialized install.Options.
StagedUpgradeInstallOptions
// StateEncryptionConfig stores JSON-serialized v1alpha1.Encryption.
StateEncryptionConfig
// MetalNetworkPlatformConfig stores serialized NetworkPlatformConfig for the `metal` platform.
MetalNetworkPlatformConfig
// DownloadURLCode stores the value of the `${code}` variable in the download URL for talos.config= URL.
DownloadURLCode
// UserReserved1 is reserved for user-defined metadata.
UserReserved1
// UserReserved2 is reserved for user-defined metadata.
UserReserved2
// UserReserved3 is reserved for user-defined metadata.
UserReserved3
)