types

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 10 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllArchs = []Architecture{
	_386,
	amd64,
	arm64,
	armv6,
	armv7,
	ppc64le,
	riscv64,
	s390x,
}

AllArchs contains the standard set of supported architectures, which are used by `apko publish` when no architectures are specified.

Functions

This section is empty.

Types

type AccountsOption added in v0.7.0

type AccountsOption struct {
	RunAs string `yaml:"run-as,omitempty"`
}

AccountsOption describes an optional deviation to an apko environment's run-as setting.

type Architecture added in v0.2.0

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

Architecture represents a CPU architecture for the container image. TODO(kaniini): Maybe this should be its own package at this point?

func ParseArchitecture added in v0.2.0

func ParseArchitecture(s string) Architecture

ParseArchitecture parses a single architecture in string form, and returns the equivalent Architecture value.

Any apk-style arch string (e.g., "x86_64") is converted to the OCI-style equivalent ("amd64").

func ParseArchitectures added in v0.2.0

func ParseArchitectures(in []string) []Architecture

ParseArchitectures parses architecture values in string form, and returns the equivalent slice of Architectures.

apk-style arch strings (e.g., "x86_64") are converted to the OCI-style equivalent ("amd64"). Values are deduped, and the resulting slice is sorted for reproducibility.

func (Architecture) Compatible added in v0.2.0

func (a Architecture) Compatible(b Architecture) bool

func (Architecture) String added in v0.2.0

func (a Architecture) String() string

func (Architecture) ToAPK added in v0.2.0

func (a Architecture) ToAPK() string

ToAPK returns the apk-style equivalent string for the Architecture.

func (Architecture) ToOCIPlatform added in v0.2.0

func (a Architecture) ToOCIPlatform() *v1.Platform

func (Architecture) ToQEmu added in v0.2.0

func (a Architecture) ToQEmu() string

func (Architecture) ToRustTriplet added in v0.6.0

func (a Architecture) ToRustTriplet(suffix string) string

func (Architecture) ToTriplet added in v0.6.0

func (a Architecture) ToTriplet(suffix string) string

func (*Architecture) UnmarshalYAML added in v0.3.0

func (a *Architecture) UnmarshalYAML(unmarshal func(interface{}) error) error

type BuildOption added in v0.7.0

type BuildOption struct {
	Contents ContentsOption `yaml:"contents,omitempty"`
	Accounts AccountsOption `yaml:"accounts,omitempty"`

	Environment map[string]string `yaml:"environment,omitempty"`

	Entrypoint ImageEntrypoint `yaml:"entrypoint,omitempty"`
}

BuildOption describes an optional deviation to an apko environment.

func (BuildOption) Apply added in v0.7.0

func (bo BuildOption) Apply(ic *ImageConfiguration) error

Apply applies a patch described by a BuildOption to an apko environment.

type ContentsOption added in v0.7.0

type ContentsOption struct {
	Packages ListOption `yaml:"packages,omitempty"`
}

ContentsOption describes an optional deviation to an apko environment's contents block.

type Group added in v0.2.0

type Group struct {
	GroupName string
	GID       uint32
	Members   []string
}

type ImageAccounts added in v0.7.0

type ImageAccounts struct {
	RunAs  string `yaml:"run-as"`
	Users  []User
	Groups []Group
}

type ImageConfiguration

type ImageConfiguration struct {
	Contents    ImageContents     `yaml:"contents,omitempty"`
	Entrypoint  ImageEntrypoint   `yaml:"entrypoint,omitempty"`
	Cmd         string            `yaml:"cmd,omitempty"`
	WorkDir     string            `yaml:"work-dir,omitempty"`
	Accounts    ImageAccounts     `yaml:"accounts,omitempty"`
	Archs       []Architecture    `yaml:"archs,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty"`
	Paths       []PathMutation    `yaml:"paths,omitempty"`
	OSRelease   OSRelease         `yaml:"os-release,omitempty"`
	VCSUrl      string            `yaml:"vcs-url,omitempty"`
	Annotations map[string]string `yaml:"annotations,omitempty"`
	Include     string            `yaml:"include,omitempty"`

	Options map[string]BuildOption `yaml:"options,omitempty"`
}

func (*ImageConfiguration) Load

func (ic *ImageConfiguration) Load(imageConfigPath string, logger *logrus.Entry) error

Loads an image configuration given a configuration file path.

func (*ImageConfiguration) ProbeVCSUrl added in v0.5.0

func (ic *ImageConfiguration) ProbeVCSUrl(imageConfigPath string, logger *logrus.Entry)

Attempt to probe an upstream VCS URL if known.

func (*ImageConfiguration) Summarize added in v0.2.0

func (ic *ImageConfiguration) Summarize(logger *logrus.Entry)

func (*ImageConfiguration) Validate

func (ic *ImageConfiguration) Validate() error

Do preflight checks and mutations on an image configuration.

func (*ImageConfiguration) ValidateServiceBundle

func (ic *ImageConfiguration) ValidateServiceBundle() error

Do preflight checks and mutations on an image configured to manage a service bundle.

type ImageContents added in v0.7.0

type ImageContents struct {
	Repositories []string `yaml:"repositories,omitempty"`
	Keyring      []string `yaml:"keyring,omitempty"`
	Packages     []string `yaml:"packages,omitempty"`
}

type ImageEntrypoint added in v0.7.0

type ImageEntrypoint struct {
	Type          string
	Command       string
	ShellFragment string `yaml:"shell-fragment"`

	// TBD: presently a map of service names and the command to run
	Services map[interface{}]interface{}
}

type ListOption added in v0.7.0

type ListOption struct {
	Add    []string `yaml:"add,omitempty"`
	Remove []string `yaml:"remove,omitempty"`
}

ListOption describes an optional deviation to a list, for example, a list of packages.

type OSRelease added in v0.3.0

type OSRelease struct {
	Name         string
	ID           string
	VersionID    string `yaml:"version-id"`
	PrettyName   string `yaml:"pretty-name"`
	HomeURL      string `yaml:"home-url"`
	BugReportURL string `yaml:"bug-report-url"`
}

type PathMutation added in v0.3.0

type PathMutation struct {
	Path        string
	Type        string
	UID         uint32
	GID         uint32
	Permissions uint32
	Source      string
	Recursive   bool
}

type User added in v0.2.0

type User struct {
	UserName string
	UID      uint32
	GID      uint32
}

Jump to

Keyboard shortcuts

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