seed

package
v0.0.0-...-18a2d44 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package seed offers a number of useful functions to parse the user provided initial seed data/configuration.

Index

Constants

View Source
const SeedPartitionPath = "/dev/disk/by-partlabel/seed-data"

SeedPartitionPath defines the path to the expected seed partition.

Variables

View Source
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.

View Source
var ErrNoSeedPartition = errors.New("no seed partition could be found")

ErrNoSeedPartition is returned when the seed partition couldn't be found.

View Source
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

func GetApplications(_ context.Context, partition string) (*apiseed.Applications, error)

GetApplications extracts the list of applications from the seed data.

func GetIncus

func GetIncus(_ context.Context, partition string) (*apiseed.Incus, error)

GetIncus extracts the Incus preseed from the seed data.

func GetInstall

func GetInstall(partition string) (*apiseed.Install, error)

GetInstall extracts the installation config from the seed data.

func GetNetwork

func GetNetwork(ctx context.Context, partition string) (*api.SystemNetworkConfig, error)

GetNetwork extracts the network configuration from the seed data. If no seed network found, a default minimal network config will be returned.

func GetProvider

func GetProvider(_ context.Context, partition string) (*apiseed.Provider, error)

GetProvider extracts the provider configuration from the seed data.

func IsMissing

func IsMissing(e error) bool

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.

Jump to

Keyboard shortcuts

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