-
Notifications
You must be signed in to change notification settings - Fork 43
/
stage.go
27 lines (23 loc) · 911 Bytes
/
stage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package osbuild
// Single stage of a pipeline executing one step
type Stage struct {
// Well-known name in reverse domain-name notation, uniquely identifying
// the stage type.
Type string `json:"type"`
// Stage-type specific options fully determining the operations of the
Inputs Inputs `json:"inputs,omitempty"`
Options StageOptions `json:"options,omitempty"`
Devices map[string]Device `json:"devices,omitempty"`
Mounts []Mount `json:"mounts,omitempty"`
}
// StageOptions specify the operations of a given stage-type.
type StageOptions interface {
isStageOptions()
}
// MountOSTree adds an ostree mount to a stage which makes it run in a deployed
// ostree stateroot.
func (s *Stage) MountOSTree(osName, ref string, serial int) {
name := "ostree-" + ref
ostreeMount := NewOSTreeDeploymentMount(name, osName, ref, serial)
s.Mounts = append(s.Mounts, *ostreeMount)
}