labels

package
v12.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemeHost = "host"

	SchemeDocker = "docker"
	ArgDocker    = "//node:22-bookworm"

	SchemeLXC = "lxc"
	ArgLXC    = "//debian:bookworm"

	// OptionPlatform is the name of the label option that sets the OS/architecture passed to the
	// container runtime, e.g. "platform=linux/amd64".
	OptionPlatform = "platform"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Label

type Label struct {
	Name   string
	Schema string
	Arg    string
	// Options are encoded in the string form as a trailing query, e.g. "...?platform=linux/amd64".
	Options map[string]string
}

func MustParse added in v12.7.0

func MustParse(str string) *Label

MustParse is like Parse but panics if the string cannot be parsed.

func Parse

func Parse(str string) (*Label, error)

func (*Label) Platform added in v12.12.0

func (l *Label) Platform() string

Platform returns the configured OS/architecture for the label, or "" if unset.

func (*Label) String added in v12.7.0

func (l *Label) String() string

String returns the string representation of a Label. It is the inverse operation of Parse.

type Labels

type Labels []*Label

func (Labels) Names

func (l Labels) Names() []string

func (Labels) PickDockerImagePlatform added in v12.12.0

func (l Labels) PickDockerImagePlatform(runsOn []string) string

PickDockerImagePlatform returns the Docker image platform (e.g. "linux/amd64") configured for the first matching docker label in runsOn, or "" when none is set.

func (Labels) PickPlatform

func (l Labels) PickPlatform(runsOn []string) string

func (Labels) RequireDocker

func (l Labels) RequireDocker() bool

func (Labels) Strings added in v12.7.0

func (l Labels) Strings() []string

Jump to

Keyboard shortcuts

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