Documentation ¶
Index ¶
- Constants
- Variables
- func AppContext(context *cli.Context) (gocontext.Context, gocontext.CancelFunc)
- func ContentStoreOptions(context *cli.Context) []store.Option
- func GetPlatforms(ctx context.Context, cliContext *cli.Context, img images.Image, ...) ([]ocispec.Platform, error)
- func NewClient(context *cli.Context, opts ...containerd.ClientOpt) (*containerd.Client, gocontext.Context, gocontext.CancelFunc, error)
- func SupportedArg[K comparable](v K, list []K) bool
Constants ¶
const ( ExistingIndexFlagName = "existing-index" Warn = "warn" Skip = "skip" Allow = "allow" )
const ( PlatformFlagKey = "platform" AllPlatformsFlagKey = "all-platforms" )
Variables ¶
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 `, }
var LabelFlag = cli.StringSliceFlag{
Name: "label",
Usage: "Labels to attach to the image",
}
var PlatformFlags = []cli.Flag{ cli.BoolFlag{ Name: AllPlatformsFlagKey, Usage: "", }, cli.StringSliceFlag{ Name: PlatformFlagKey + ", p", Usage: "", }, }
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", }, }
var SnapshotterFlags = []cli.Flag{ cli.StringFlag{ Name: "snapshotter", Usage: "Snapshotter name. Empty value stands for the default value.", EnvVar: "CONTAINERD_SNAPSHOTTER", }, }
var SupportedExistingIndexOptions = []string{Warn, Skip, Allow}
Functions ¶
func AppContext ¶
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 ¶
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 ¶
func NewClient(context *cli.Context, opts ...containerd.ClientOpt) (*containerd.Client, gocontext.Context, gocontext.CancelFunc, error)
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.