Documentation
¶
Overview ¶
Package image contains utilities for managing btpeer images.
Index ¶
- func BtpeerHasImageBuildInfoFile(ctx context.Context, sshRunner ssh.Runner) (bool, error)
- func FetchBtpeerImageBuildInfo(ctx context.Context, sshRunner ssh.Runner) (*labapi.RaspiosCrosBtpeerImageBuildInfo, error)
- func FetchBtpeerImageReleaseConfig(ctx context.Context, runner components.Runner) (*labapi.RaspiosCrosBtpeerImageConfig, error)
- func MarshalBtpeerImageReleaseConfig(config *labapi.RaspiosCrosBtpeerImageConfig) (string, error)
- func SelectBtpeerImageByUUID(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig, ...) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
- func SelectBtpeerImageForDut(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig, ...) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
- func SelectCurrentBtpeerImage(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
- func SelectNextBtpeerImage(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BtpeerHasImageBuildInfoFile ¶
BtpeerHasImageBuildInfoFile checks the btpeer host via the provided runner to determine if the build info file exists.
func FetchBtpeerImageBuildInfo ¶
func FetchBtpeerImageBuildInfo(ctx context.Context, sshRunner ssh.Runner) (*labapi.RaspiosCrosBtpeerImageBuildInfo, error)
FetchBtpeerImageBuildInfo reads and parses the image build info file on the host using the provided runner and returns the unmarshalled result.
func FetchBtpeerImageReleaseConfig ¶
func FetchBtpeerImageReleaseConfig(ctx context.Context, runner components.Runner) (*labapi.RaspiosCrosBtpeerImageConfig, error)
FetchBtpeerImageReleaseConfig downloads the production RaspiosCrosBtpeerImageConfig JSON file from GCS via its public URL through the runner host and returns its unmarshalled contents.
Note: We use the public URL here rather than the cache to ensure we always use the latest version of the config file from GCS.
func MarshalBtpeerImageReleaseConfig ¶
func MarshalBtpeerImageReleaseConfig(config *labapi.RaspiosCrosBtpeerImageConfig) (string, error)
MarshalBtpeerImageReleaseConfig marshals the config into JSON using the same settings as btpeer_manager, which is what is used to create the config JSON that this would be parsed from, so that the look is consistent.
func SelectBtpeerImageByUUID ¶
func SelectBtpeerImageByUUID(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig, imageUUID string) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
SelectBtpeerImageByUUID returns the first image in config.Images with a matching image UUID. Returns non-nil error if no matching images found.
func SelectBtpeerImageForDut ¶
func SelectBtpeerImageForDut(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig, dutHostname string) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
SelectBtpeerImageForDut returns the next image if the dutHostname is in the config.NextImageVerificationDutPool (see SelectNextBtpeerImage), or the current image if not (see SelectCurrentBtpeerImage).
func SelectCurrentBtpeerImage ¶
func SelectCurrentBtpeerImage(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
SelectCurrentBtpeerImage returns the current image, as defined by config.CurrentImageUuid. Returns a non-nil error if no matching images were found or if config.CurrentImageUuid is empty.
func SelectNextBtpeerImage ¶
func SelectNextBtpeerImage(ctx context.Context, config *labapi.RaspiosCrosBtpeerImageConfig) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)
SelectNextBtpeerImage returns the next image, as defined by config.NextImageUuid. If config.NextImageUuid is empty, the current image is selected instead via SelectCurrentBtpeerImage. Returns a non-nil error if no matching images were found.
Types ¶
This section is empty.