Documentation
¶
Overview ¶
Package seed offers a number of useful functions to parse the user provided initial seed data/configuration.
Index ¶
- Constants
- Variables
- func GetApplications(_ context.Context, partition string) (*apiseed.Applications, error)
- func GetIncus(_ context.Context, partition string) (*apiseed.Incus, error)
- func GetInstall(partition string) (*apiseed.Install, error)
- func GetNetwork(ctx context.Context, partition string) (*api.SystemNetworkConfig, error)
- func GetProvider(_ context.Context, partition string) (*apiseed.Provider, error)
- func IsMissing(e error) bool
- func NetworkConfigHasEmptyDevices(networkCfg api.SystemNetworkConfig) bool
Constants ¶
const SeedPartitionPath = "/dev/disk/by-partlabel/seed-data"
SeedPartitionPath defines the path to the expected seed partition.
Variables ¶
var ErrNoSeedData = errors.New("no seed data present in the partition")
ErrNoSeedData is returned when a partition could be found but no data was found in it.
var ErrNoSeedPartition = errors.New("no seed partition could be found")
ErrNoSeedPartition is returned when the seed partition couldn't be found.
var ErrNoSeedSection = errors.New("requested seed section couldn't be found")
ErrNoSeedSection is returned when the seed data is available but the requested section/file couldn't be found.
Functions ¶
func GetApplications ¶
GetApplications extracts the list of applications from the seed data.
func GetInstall ¶
GetInstall extracts the installation config from the seed data.
func GetNetwork ¶
GetNetwork extracts the network configuration from the seed data. If no seed network found, a default minimal network config will be returned.
func GetProvider ¶
GetProvider extracts the provider configuration from the seed data.
func IsMissing ¶
IsMissing checks whether the provided error is an expected error for missing seed data.
func NetworkConfigHasEmptyDevices ¶
func NetworkConfigHasEmptyDevices(networkCfg api.SystemNetworkConfig) bool
NetworkConfigHasEmptyDevices checks if any device (interface, bond, or vlan) is defined in the given config.
Types ¶
This section is empty.