osimage

package
v0.38.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package osimage pushes an OS image's bytes to the platform's object store over the pre-signed targets the upload subresource hands out, so they never pass through the platform itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Uploader

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

Uploader runs the upload flow against one platform.

func NewUploader

func NewUploader(images managementv1client.OSImageInterface, logger log.Logger) *Uploader

func (*Uploader) Finalize

func (u *Uploader) Finalize(ctx context.Context, name, checksum string) error

Finalize assembles the uploaded parts into the object and records checksum. It is split from Upload so a caller can hash the file after the first upload call has been accepted, rather than reading a multi gigabyte image before the platform has said yes.

func (*Uploader) Upload

func (u *Uploader) Upload(ctx context.Context, name string, src io.ReaderAt, sizeBytes int64) error

Upload pushes sizeBytes from src to the image's store. It pages through the upload subresource, uploading each batch before asking for the next, so a target is used close to when it was signed. Finalize assembles the object afterwards.

func (*Uploader) WaitForReady

func (u *Uploader) WaitForReady(ctx context.Context, name string, timeout time.Duration) error

WaitForReady polls until the controller has verified the object. Finalize only assembles it; the phase is what says the stored size matched what we declared.

Jump to

Keyboard shortcuts

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