staging

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultStagingDirectory The location where staging happens
	DefaultStagingDirectory = "/var/lib/darch/stage"
	// DefaultStagingDirectoryImages The location to the staged images live.
	DefaultStagingDirectoryImages = path.Join(DefaultStagingDirectory, "live")
	// DefaultStagingDirectoryTmp Temp directory for staging stuff (extracting images, running hooks, etc)
	DefaultStagingDirectoryTmp = path.Join(DefaultStagingDirectory, "tmp")
	// DefaultStagingImagesFile File where our staged images information lives.
	DefaultStagingImagesFile = path.Join(DefaultStagingDirectory, "images.json")
)
View Source
var (
	// DefaultGrubConfigPath The location where the grub.cfg for darch is stored.
	DefaultGrubConfigPath = "/etc/darch/grub.cfg"
)

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session A staging session.

func NewSession

func NewSession() (*Session, error)

NewSession Create a new staging session.

func (*Session) Clean

func (session *Session) Clean() error

Clean goes through all the images in the live directory and deletes them if there isn't a references in images.json.

func (*Session) GetAllStaged

func (session *Session) GetAllStaged() ([]StagedImageNamed, error)

GetAllStaged Get all the staged items in the given directory.

func (*Session) GetCurrentBootedImage

func (session *Session) GetCurrentBootedImage() (StagedImageNamed, error)

GetCurrentBootedImage Looks at /proc/cmdline to try and determine what image is currently booted. Returns reference.ErrDoesNotExist if entry isn't present.

func (*Session) IsStaged

func (session *Session) IsStaged(imageRef reference.ImageRef) (bool, error)

IsStaged Is the given reference currently staged?

func (*Session) PrintGrubMenuEntry

func (session *Session) PrintGrubMenuEntry(stagedImage StagedImageNamed, output io.Writer) error

PrintGrubMenuEntry Print the grub entry for the given staged image.

func (*Session) Remove

func (session *Session) Remove(imageRef reference.ImageRef) error

Remove Removes an image from the stage.

func (*Session) RunAllHooks

func (session *Session) RunAllHooks() error

RunAllHooks Run the hooks on every image.

func (*Session) RunHooksForImage

func (session *Session) RunHooksForImage(imageRef reference.ImageRef) error

RunHooksForImage Run hooks for a single image.

func (*Session) SyncBootloader

func (session *Session) SyncBootloader() error

SyncBootloader Updates the /etc/darch/grub.cfg to represent the current stage.

func (*Session) Tag

func (session *Session) Tag(sourceImageRef, destinationImageRef reference.ImageRef, force bool) error

Tag Tag a staged image as something else.

func (*Session) UploadDirectoryWithMove

func (session *Session) UploadDirectoryWithMove(imageDir string, imageRef reference.ImageRef, force bool) error

UploadDirectoryWithMove Moves (not copy) a directory to staging for boot.

type StagedImage

type StagedImage struct {
	Dir       string
	Kernel    string
	InitRAMFS string
	RootFS    string
}

StagedImage A staged image

type StagedImageNamed

type StagedImageNamed struct {
	StagedImage
	Ref reference.ImageRef
	ID  string
}

StagedImageNamed A StagedImage with a name and tag

Jump to

Keyboard shortcuts

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