Documentation ¶
Overview ¶
Package seed implements loading and validating of seed data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAssertions = errors.New("no seed assertions") ErrNoMeta = errors.New("no seed metadata") )
Functions ¶
func MockTrusted ¶
func ValidateFromYaml ¶
ValidateFromYaml validates the given seed.yaml file and surrounding seed.
Types ¶
type EssentialMetaLoaderSeed ¶
type EssentialMetaLoaderSeed interface { Seed // LoadEssentialMeta loads the seed's snaps metadata for the // essential snaps with types in the essentialTypes set while // verifying them against assertions. It can return ErrNoMeta // if there is no metadata nor snaps in the seed, this is // legitimate only on classic. It is an error to call LoadMeta // before LoadAssertions or to mix it with LoadMeta. LoadEssentialMeta(essentialTypes []snap.Type, tm timings.Measurer) error }
EssentialMetaLoaderSeed is a Seed that can be asked to load and verify only a subset of the essential model snaps via LoadEssentialMeta.
type NoSnapDeclarationError ¶
type NoSnapDeclarationError struct {
// contains filtered or unexported fields
}
func (*NoSnapDeclarationError) Error ¶
func (e *NoSnapDeclarationError) Error() string
type Seed ¶
type Seed interface { // LoadAssertions loads all assertions from the seed with // cross-checks. A read-only view on an assertions database // can be passed in together with a commitTo function which // will be used to commit the assertions to the underlying // database. If db is nil an internal temporary database will // be setup instead. ErrNoAssertions will be returned if there // is no assertions directory in the seed, this is legitimate // only on classic. LoadAssertions(db asserts.RODatabase, commitTo func(*asserts.Batch) error) error // Model returns the seed provided model assertion. It is an // error to call Model before LoadAssertions. Model() (*asserts.Model, error) // LoadMeta loads the seed and seed's snaps metadata while // verifying the underlying snaps against assertions. It can // return ErrNoMeta if there is no metadata nor snaps in the // seed, this is legitimate only on classic. It is an error to // call LoadMeta before LoadAssertions. LoadMeta(tm timings.Measurer) error // UsesSnapdSnap returns whether the system as defined by the // seed will use the snapd snap, after LoadMeta. UsesSnapdSnap() bool // EssentialSnaps returns the essential snaps as defined by // the seed, after LoadMeta. EssentialSnaps() []*Snap // ModeSnaps returns the snaps that should be available // in the given mode as defined by the seed, after LoadMeta. ModeSnaps(mode string) ([]*Snap, error) }
Seed supports loading assertions and seed snaps' metadata.
type Snap ¶
type Snap struct { Path string SideInfo *snap.SideInfo // EssentialType is the type of the snap as specified by the model. // Provided only for essential snaps (Essential = true). EssentialType snap.Type Essential bool Required bool // options Channel string DevMode bool Classic bool }
Snap holds the details of a snap in a seed.
Directories ¶
Path | Synopsis |
---|---|
Package internal (of seed) provides types and helpers used internally by both seed and seed/seedwriter.
|
Package internal (of seed) provides types and helpers used internally by both seed and seed/seedwriter. |
Package seedwrite implements writing image seeds.
|
Package seedwrite implements writing image seeds. |
Click to show internal directories.
Click to hide internal directories.