internal

package
v0.0.0-...-d25a2ea Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExistingIndexFlagName = "existing-index"
	Warn                  = "warn"
	Skip                  = "skip"
	Allow                 = "allow"
)
View Source
const (
	PlatformFlagKey     = "platform"
	AllPlatformsFlagKey = "all-platforms"
)

Variables

View Source
var ExistingIndexFlag = cli.StringFlag{
	Name:  ExistingIndexFlagName,
	Value: Warn,
	Usage: `Configure how to handle existing SOCI artifacts in remote when pushing indices
			warn  - print warning message to stdout but push index anyway
			skip  - skip pushing the index
			allow - push the index regardless
	`,
}
View Source
var LabelFlag = cli.StringSliceFlag{
	Name:  "label",
	Usage: "Labels to attach to the image",
}
View Source
var PlatformFlags = []cli.Flag{
	cli.BoolFlag{
		Name:  AllPlatformsFlagKey,
		Usage: "",
	},
	cli.StringSliceFlag{
		Name:  PlatformFlagKey + ", p",
		Usage: "",
	},
}
View Source
var RegistryFlags = []cli.Flag{
	cli.BoolFlag{
		Name:  "skip-verify,k",
		Usage: "Skip SSL certificate validation",
	},
	cli.BoolFlag{
		Name:  "plain-http",
		Usage: "Allow connections using plain HTTP",
	},
	cli.StringFlag{
		Name:  "user,u",
		Usage: "User[:password] Registry user and password",
	},
	cli.StringFlag{
		Name:  "refresh",
		Usage: "Refresh token for authorization server",
	},
	cli.StringFlag{
		Name: "hosts-dir",

		Usage: "Custom hosts configuration directory",
	},
	cli.StringFlag{
		Name:  "tlscacert",
		Usage: "Path to TLS root CA",
	},
	cli.StringFlag{
		Name:  "tlscert",
		Usage: "Path to TLS client certificate",
	},
	cli.StringFlag{
		Name:  "tlskey",
		Usage: "Path to TLS client key",
	},
	cli.BoolFlag{
		Name:  "http-dump",
		Usage: "Dump all HTTP request/responses when interacting with container registry",
	},
	cli.BoolFlag{
		Name:  "http-trace",
		Usage: "Enable HTTP tracing for registry interactions",
	},
}
View Source
var SnapshotterFlags = []cli.Flag{
	cli.StringFlag{
		Name:   "snapshotter",
		Usage:  "Snapshotter name. Empty value stands for the default value.",
		EnvVar: "CONTAINERD_SNAPSHOTTER",
	},
}
View Source
var SupportedExistingIndexOptions = []string{Warn, Skip, Allow}

Functions

func AppContext

func AppContext(context *cli.Context) (gocontext.Context, gocontext.CancelFunc)

AppContext returns the context for a command. Should only be called once per command, near the start.

This will ensure the namespace is picked up and set the timeout, if one is defined.

func ContentStoreOptions

func ContentStoreOptions(context *cli.Context) []store.Option

ContentStoreOptions builds a list of content store options from a CLI context.

func GetPlatforms

func GetPlatforms(ctx context.Context, cliContext *cli.Context, img images.Image, cs content.Store) ([]ocispec.Platform, error)

GetPlatforms returns the set of platforms from a cli.Context The order of preference is: 1) all platforms supported by the image if the `all-plaforms` flag is set 2) the set of platforms specified by the `platform` flag 3) the default platform

This method is not suitable for situations where the default should be all supported platforms (e.g. the `soci index list` command)

func NewClient

NewClient returns a new containerd client

func SupportedArg

func SupportedArg[K comparable](v K, list []K) bool

SupportedArg checks if a value is present within a given slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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