image

package
v0.0.0-...-7f005ae Latest Latest
Warning

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

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

Documentation

Overview

Package image provides commands for managing release images on btpeers.

Index

Constants

View Source
const (
	ChromeOSConnectivityTestArtifactsStorageBucket = "chromeos-connectivity-test-artifacts"
)

Variables

This section is empty.

Functions

func SelectBtpeerImageByUUID

func SelectBtpeerImageByUUID(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(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.

func SetSharedManagerInstance

func SetSharedManagerInstance(m *Manager)

Types

type Manager

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

func NewManager

func NewManager(ctx context.Context, managerConfig *ManagerConfig) (*Manager, error)

func SharedManagerInstance

func SharedManagerInstance() *Manager

func (*Manager) Config

func (*Manager) ConfigObject

func (m *Manager) ConfigObject() (string, *storage.ObjectHandle)

func (*Manager) DownloadImage

func (m *Manager) DownloadImage(ctx context.Context, imageConfig *labapi.RaspiosCrosBtpeerImageConfig_OSImage, dstDir string) (string, error)

func (*Manager) FetchConfig

func (m *Manager) FetchConfig(ctx context.Context) error

func (*Manager) InitializeNewConfig

func (m *Manager) InitializeNewConfig(ctx context.Context, forceOverwriteExisting bool) error

func (*Manager) UpdateConfig

func (*Manager) UploadImage

func (m *Manager) UploadImage(ctx context.Context, imageFilePath string) (*labapi.RaspiosCrosBtpeerImageConfig_OSImage, error)

UploadImage will upload an image file located at imageFilePath and its *.info and raspios_cros_btpeer_build_info.json files expected to be in the same pi-gen-btpeer deploy dir like so:

pi-gen-btpeer/deploy/

<base_image_filename>.info
image_<base_image_filename>.img(.xz|.gz)?
raspios_cros_btpeer_build_info.json

func (*Manager) ValidateConfig

func (m *Manager) ValidateConfig(config *labapi.RaspiosCrosBtpeerImageConfig) error

type ManagerConfig

type ManagerConfig struct {
	StorageBucketName      string
	UseProdConfig          bool
	GCSCredentialsFilePath string
}

Jump to

Keyboard shortcuts

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