parse

package
v1.35.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 32 Imported by: 43

Documentation

Index

Constants

View Source
const (
	// SeccompDefaultPath defines the default seccomp path
	SeccompDefaultPath = config.SeccompDefaultPath
	// SeccompOverridePath if this exists it overrides the default seccomp path
	SeccompOverridePath = config.SeccompOverridePath
	// TypeBind is the type for mounting host dir
	TypeBind = "bind"
	// TypeTmpfs is the type for mounting tmpfs
	TypeTmpfs = "tmpfs"
	// TypeCache is the type for mounting a common persistent cache from host
	TypeCache = "cache"
	// mount=type=cache must create a persistent directory on host so it's available for all consecutive builds.
	// Lifecycle of following directory will be inherited from how host machine treats temporary directory
	BuildahCacheDir = "buildah-cache"
)

Variables

This section is empty.

Functions

func AuthConfig added in v1.22.0

func AuthConfig(creds string) (*types.DockerAuthConfig, error)

AuthConfig parses the creds in format [username[:password] into an auth config.

func CommonBuildOptions

func CommonBuildOptions(c *cobra.Command) (*define.CommonBuildOptions, error)

CommonBuildOptions parses the build options from the bud cli

func CommonBuildOptionsFromFlagSet added in v1.24.0

func CommonBuildOptionsFromFlagSet(flags *pflag.FlagSet, findFlagFunc func(name string) *pflag.Flag) (*define.CommonBuildOptions, error)

CommonBuildOptionsFromFlagSet parses the build options from the bud cli

func ContainerIgnoreFile added in v1.24.0

func ContainerIgnoreFile(contextDir, path string, containerFiles []string) ([]string, string, error)

ContainerIgnoreFile consumes path to `dockerignore` or `containerignore` and returns list of files to exclude along with the path to processed ignore file. Deprecated since this might become internal only, please avoid relying on this function.

func DefaultPlatform added in v1.13.2

func DefaultPlatform() string

DefaultPlatform returns the standard platform for the current system

func Device added in v1.11.1

func Device(device string) (string, string, string, error)

Device parses device mapping string to a src, dest & permissions string Valid values for device look like:

'/dev/sdc"
'/dev/sdc:/dev/xvdc"
'/dev/sdc:/dev/xvdc:rwm"
'/dev/sdc:rm"

func DeviceFromPath added in v1.11.1

func DeviceFromPath(device string) (define.ContainerDevices, error)

func GetAdditionalBuildContext added in v1.26.4

func GetAdditionalBuildContext(value string) (define.AdditionalBuildContext, error)

GetAdditionalBuildContext consumes raw string and returns parsed AdditionalBuildContext

func GetAutoOptions added in v1.27.0

func GetAutoOptions(base string) (*storageTypes.AutoUserNsOptions, error)

GetAutoOptions returns a AutoUserNsOptions with the settings to setup automatically a user namespace.

func GetBuildOutput added in v1.26.0

func GetBuildOutput(buildOutput string) (define.BuildOutputOption, error)

GetBuildOutput is responsible for parsing custom build output argument i.e `build --output` flag. Takes `buildOutput` as string and returns BuildOutputOption

func GetConfidentialWorkloadOptions added in v1.32.0

func GetConfidentialWorkloadOptions(arg string) (define.ConfidentialWorkloadOptions, error)

GetConfidentialWorkloadOptions parses a confidential workload settings argument, which controls both whether or not we produce an image that expects to be run using krun, and how we handle things like encrypting the disk image that the container image will contain.

func GetTempDir added in v1.13.0

func GetTempDir() string

GetTempDir returns the path of the preferred temporary directory on the host.

func IDMappingOptions

func IDMappingOptions(c *cobra.Command, isolation define.Isolation) (usernsOptions define.NamespaceOptions, idmapOptions *define.IDMappingOptions, err error)

IDMappingOptions parses the build options related to user namespaces and ID mapping.

func IDMappingOptionsFromFlagSet added in v1.24.0

func IDMappingOptionsFromFlagSet(flags *pflag.FlagSet, persistentFlags *pflag.FlagSet, findFlagFunc func(name string) *pflag.Flag) (usernsOptions define.NamespaceOptions, idmapOptions *define.IDMappingOptions, err error)

IDMappingOptionsFromFlagSet parses the build options related to user namespaces and ID mapping.

func IsolationOption

func IsolationOption(isolation string) (define.Isolation, error)

IsolationOption parses the --isolation flag.

func NamespaceOptions

func NamespaceOptions(c *cobra.Command) (namespaceOptions define.NamespaceOptions, networkPolicy define.NetworkConfigurationPolicy, err error)

NamespaceOptions parses the build options for all namespaces except for user namespace.

func NamespaceOptionsFromFlagSet added in v1.24.0

func NamespaceOptionsFromFlagSet(flags *pflag.FlagSet, findFlagFunc func(name string) *pflag.Flag) (namespaceOptions define.NamespaceOptions, networkPolicy define.NetworkConfigurationPolicy, err error)

NamespaceOptionsFromFlagSet parses the build options for all namespaces except for user namespace.

func Platform added in v1.20.1

func Platform(platform string) (os, arch, variant string, err error)

Platform separates the platform string into os, arch and variant, accepting any of $arch, $os/$arch, or $os/$arch/$variant.

func PlatformFromOptions added in v1.13.2

func PlatformFromOptions(c *cobra.Command) (os, arch string, err error)

PlatformFromOptions parses the operating system (os) and architecture (arch) from the provided command line options. Deprecated in favor of PlatformsFromOptions(), but kept here because it's part of our API.

func PlatformsFromOptions added in v1.22.2

func PlatformsFromOptions(c *cobra.Command) (platforms []struct{ OS, Arch, Variant string }, err error)

PlatformsFromOptions parses the operating system (os) and architecture (arch) from the provided command line options. If --platform used, it also returns the list of platforms that were passed in as its argument.

func PullPolicyFromFlagSet added in v1.35.0

func PullPolicyFromFlagSet(flags *pflag.FlagSet, findFlagFunc func(name string) *pflag.Flag) (define.PullPolicy, error)

PullPolicyFromFlagSet returns a PullPolicy that reflects the combination of the specified "pull" and undocumented "pull-always" and "pull-never" flags.

func PullPolicyFromOptions added in v1.35.0

func PullPolicyFromOptions(c *cobra.Command) (define.PullPolicy, error)

PullPolicyFromOptions returns a PullPolicy that reflects the combination of the specified "pull" and undocumented "pull-always" and "pull-never" flags.

func RepoNamesToNamedReferences added in v1.29.0

func RepoNamesToNamedReferences(destList []string) ([]reference.Named, error)

RepoNamesToNamedReferences parse the raw string to Named reference

func SBOMScanOptions added in v1.35.0

func SBOMScanOptions(c *cobra.Command) (*define.SBOMScanOptions, error)

SBOMScanOptions parses the build options from the cli

func SBOMScanOptionsFromFlagSet added in v1.35.0

func SBOMScanOptionsFromFlagSet(flags *pflag.FlagSet, findFlagFunc func(name string) *pflag.Flag) (*define.SBOMScanOptions, error)

SBOMScanOptionsFromFlagSet parses scan settings from the cli

func SSH added in v1.22.2

func SSH(sshSources []string) (map[string]*sshagent.Source, error)

SSH parses the --ssh flag

func Secrets added in v1.21.0

func Secrets(secrets []string) (map[string]define.Secret, error)

Secrets parses the --secret flag

func SplitStringWithColonEscape added in v1.24.0

func SplitStringWithColonEscape(str string) []string

Split string into slice by colon. Backslash-escaped colon (i.e. "\:") will not be regarded as separator

func SystemContextFromFlagSet added in v1.24.0

func SystemContextFromFlagSet(flags *pflag.FlagSet, findFlagFunc func(name string) *pflag.Flag) (*types.SystemContext, error)

SystemContextFromFlagSet returns a SystemContext populated with values per the input parameters provided by the caller for the use in authentication.

func SystemContextFromOptions

func SystemContextFromOptions(c *cobra.Command) (*types.SystemContext, error)

SystemContextFromOptions returns a SystemContext populated with values per the input parameters provided by the caller for the use in authentication.

func TeeType added in v1.33.0

func TeeType(teeType string) define.TeeType

TeeType parses a string value and returns a TeeType

func ValidateVolumeCtrDir added in v1.8.3

func ValidateVolumeCtrDir(ctrDir string) error

ValidateVolumeCtrDir validates a volume mount's destination directory.

func ValidateVolumeHostDir added in v1.8.3

func ValidateVolumeHostDir(hostDir string) error

ValidateVolumeHostDir validates a volume mount's source directory

func ValidateVolumeOpts added in v1.8.3

func ValidateVolumeOpts(options []string) ([]string, error)

ValidateVolumeOpts validates a volume's options

func Volume added in v1.10.0

func Volume(volume string) (specs.Mount, error)

Volume parses the input of --volume

func Volumes added in v1.10.0

func Volumes(volumes []string) error

Volumes validates the host and container paths passed in to the --volume flag

Types

This section is empty.

Jump to

Keyboard shortcuts

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