image

package
v0.0.0-...-5888cca Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package image contains utilities for managing btpeer images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BtpeerHasImageBuildInfoFile

func BtpeerHasImageBuildInfoFile(ctx context.Context, sshRunner ssh.Runner) (bool, error)

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

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

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

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.

Jump to

Keyboard shortcuts

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