helpers

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Category   = "category"
	Management = "management"
)

Variables

This section is empty.

Functions

func AddDurationFlag

func AddDurationFlag(cmd *cobra.Command, name string, aliases []string, value time.Duration, env, usage string)

AddDurationFlag is similar to cmd.Flags().Duration but supports aliases and env var

func AddIntFlag

func AddIntFlag(cmd *cobra.Command, name string, aliases []string, value int, env, usage string)

AddIntFlag is similar to cmd.Flags().Int but supports aliases and env var

func AddPersistentBoolFlag

func AddPersistentBoolFlag(cmd *cobra.Command, name string, aliases, nonPersistentAliases []string, value bool, env, usage string)

AddPersistentBoolFlag is similar to AddBoolFlag but persistent. See https://github.com/spf13/cobra/blob/main/user_guide.md#persistent-flags to learn what is "persistent".

func AddPersistentStringArrayFlag

func AddPersistentStringArrayFlag(cmd *cobra.Command, name string, aliases, nonPersistentAliases []string, value []string, env string, usage string)

AddPersistentStringArrayFlag is similar to cmd.Flags().StringArray but supports aliases and env var and persistent. See https://github.com/spf13/cobra/blob/main/user_guide.md#persistent-flags to learn what is "persistent".

func AddPersistentStringFlag

func AddPersistentStringFlag(cmd *cobra.Command, name string, aliases, localAliases, persistentAliases []string, aliasToBeInherited *pflag.FlagSet, value string, env, usage string)

AddPersistentStringFlag is similar to AddStringFlag but persistent. See https://github.com/spf13/cobra/blob/main/user_guide.md#persistent-flags to learn what is "persistent".

func AddStringFlag

func AddStringFlag(cmd *cobra.Command, name string, aliases []string, value string, env, usage string)

AddStringFlag is similar to cmd.Flags().String but supports aliases and env var

func CheckExperimental

func CheckExperimental(feature string) func(cmd *cobra.Command, args []string) error

func ComposeUp

func ComposeUp(t *testing.T, base *testutil.Base, dockerComposeYAML string, opts ...string)

func Confirm

func Confirm(cmd *cobra.Command, message string) (bool, error)

func CreateBuildContext

func CreateBuildContext(t *testing.T, dockerfile string) string

func ExtractDockerArchive

func ExtractDockerArchive(archiveTarPath, rootfsPath string) error

func ExtractTarFile

func ExtractTarFile(dirPath, tarFilePath string) error

func GlobalFlags

func GlobalFlags(cmd *cobra.Command) (string, []string)

func IsExactArgs

func IsExactArgs(number int) cobra.PositionalArgs

IsExactArgs returns an error if there is not the exact number of args

func ProcessRootCmdFlags

func ProcessRootCmdFlags(cmd *cobra.Command) (types.GlobalCommandOptions, error)

func UnknownSubcommandAction

func UnknownSubcommandAction(cmd *cobra.Command, args []string) error

UnknownSubcommandAction is needed to let `nerdctl system non-existent-command` fail https://github.com/containerd/nerdctl/issues/487

Ideally this should be implemented in Cobra itself.

func VerifyOptions added in v2.0.4

func VerifyOptions(cmd *cobra.Command) (opt types.ImageVerifyOptions, err error)

Types

type CosignKeyPair

type CosignKeyPair struct {
	PublicKey  string
	PrivateKey string
	Cleanup    func()
}

func NewCosignKeyPair

func NewCosignKeyPair(t testing.TB, path string, password string) *CosignKeyPair

type DockerArchiveManifestJSON

type DockerArchiveManifestJSON []DockerArchiveManifestJSONEntry

type DockerArchiveManifestJSONEntry

type DockerArchiveManifestJSONEntry struct {
	Config   string
	RepoTags []string
	Layers   []string
}

Jump to

Keyboard shortcuts

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