summaryrefslogtreecommitdiff
path: root/cmd/podman/cliconfig
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/cliconfig')
-rw-r--r--cmd/podman/cliconfig/commands.go167
-rw-r--r--cmd/podman/cliconfig/config.go717
-rw-r--r--cmd/podman/cliconfig/create.go35
-rw-r--r--cmd/podman/cliconfig/defaults.go14
4 files changed, 0 insertions, 933 deletions
diff --git a/cmd/podman/cliconfig/commands.go b/cmd/podman/cliconfig/commands.go
deleted file mode 100644
index f6d92611f..000000000
--- a/cmd/podman/cliconfig/commands.go
+++ /dev/null
@@ -1,167 +0,0 @@
-package cliconfig
-
-import (
- "github.com/sirupsen/logrus"
-)
-
-// GlobalIsSet is a compatibility method for urfave
-func (p *PodmanCommand) GlobalIsSet(opt string) bool {
- flag := p.PersistentFlags().Lookup(opt)
- if flag == nil {
- return false
- }
- return flag.Changed
-}
-
-// IsSet is a compatibility method for urfave
-func (p *PodmanCommand) IsSet(opt string) bool {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- return false
- }
- return flag.Changed
-}
-
-// Bool is a compatibility method for urfave
-func (p *PodmanCommand) Bool(opt string) bool {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return false
- }
- val, err := p.Flags().GetBool(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// String is a compatibility method for urfave
-func (p *PodmanCommand) String(opt string) string {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return ""
- }
- val, err := p.Flags().GetString(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// StringArray is a compatibility method for urfave
-func (p *PodmanCommand) StringArray(opt string) []string {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return []string{}
- }
- val, err := p.Flags().GetStringArray(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// StringSlice is a compatibility method for urfave
-func (p *PodmanCommand) StringSlice(opt string) []string {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return []string{}
- }
- val, err := p.Flags().GetStringSlice(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// Int is a compatibility method for urfave
-func (p *PodmanCommand) Int(opt string) int {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return 0
- }
- val, err := p.Flags().GetInt(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// Unt is a compatibility method for urfave
-func (p *PodmanCommand) Uint(opt string) uint {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return 0
- }
- val, err := p.Flags().GetUint(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// Int64 is a compatibility method for urfave
-func (p *PodmanCommand) Int64(opt string) int64 {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return 0
- }
- val, err := p.Flags().GetInt64(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// Unt64 is a compatibility method for urfave
-func (p *PodmanCommand) Uint64(opt string) uint64 {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return 0
- }
- val, err := p.Flags().GetUint64(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
-
-// Float64 is a compatibility method for urfave
-func (p *PodmanCommand) Float64(opt string) float64 {
- flag := p.Flags().Lookup(opt)
- if flag == nil {
- if !p.Remote {
- logrus.Errorf("Could not find flag %s", opt)
- }
- return 0
- }
- val, err := p.Flags().GetFloat64(opt)
- if err != nil {
- logrus.Errorf("Error getting flag %s: %v", opt, err)
- }
- return val
-}
diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go
deleted file mode 100644
index 6d98aaf0e..000000000
--- a/cmd/podman/cliconfig/config.go
+++ /dev/null
@@ -1,717 +0,0 @@
-package cliconfig
-
-import (
- "net"
- "os"
-
- "github.com/containers/common/pkg/config"
- "github.com/sirupsen/logrus"
- "github.com/spf13/cobra"
-)
-
-type PodmanCommand struct {
- *cobra.Command
- InputArgs []string
- GlobalFlags MainFlags
- Remote bool
-}
-
-type MainFlags struct {
- CGroupManager string
- CniConfigDir string
- ConmonPath string
- DefaultMountsFile string
- EventsBackend string
- HooksDir []string
- MaxWorks int
- Namespace string
- Root string
- Runroot string
- Runtime string
- StorageDriver string
- StorageOpts []string
- Syslog bool
- Trace bool
- NetworkCmdPath string
-
- Config string
- CpuProfile string
- LogLevel string
- TmpDir string
-
- RemoteUserName string
- RemoteHost string
- VarlinkAddress string
- ConnectionName string
- RemoteConfigFilePath string
- Port int
- IdentityFile string
- IgnoreHosts bool
-}
-
-type AttachValues struct {
- PodmanCommand
- DetachKeys string
- Latest bool
- NoStdin bool
- SigProxy bool
-}
-
-type AutoUpdateValues struct {
- PodmanCommand
-}
-
-type ImagesValues struct {
- PodmanCommand
- All bool
- Digests bool
- Filter []string
- Format string
- Noheading bool
- NoTrunc bool
- Quiet bool
- Sort string
- History bool
-}
-
-type EventValues struct {
- PodmanCommand
- Filter []string
- Format string
- Since string
- Stream bool
- Until string
-}
-
-type TagValues struct {
- PodmanCommand
-}
-
-type TreeValues struct {
- PodmanCommand
- WhatRequires bool
-}
-
-type WaitValues struct {
- PodmanCommand
- Interval uint
- Latest bool
-}
-
-type CheckpointValues struct {
- PodmanCommand
- Keep bool
- LeaveRunning bool
- TcpEstablished bool
- All bool
- Latest bool
- Export string
- IgnoreRootfs bool
-}
-
-type CommitValues struct {
- PodmanCommand
- Change []string
- Format string
- Message string
- Author string
- Pause bool
- Quiet bool
- IncludeVolumes bool
- ImageIDFile string
-}
-
-type ContainersPrune struct {
- PodmanCommand
-}
-
-type DiffValues struct {
- PodmanCommand
- Archive bool
- Format string
- Latest bool
-}
-
-type ExecValues struct {
- PodmanCommand
- DetachKeys string
- Env []string
- EnvFile []string
- Privileged bool
- Interactive bool
- Tty bool
- User string
- Latest bool
- Workdir string
- PreserveFDs int
-}
-
-type ImageExistsValues struct {
- PodmanCommand
-}
-
-type ContainerExistsValues struct {
- PodmanCommand
-}
-
-type PodExistsValues struct {
- PodmanCommand
-}
-
-type ExportValues struct {
- PodmanCommand
- Output string
-}
-type GenerateKubeValues struct {
- PodmanCommand
- Service bool
- Filename string
-}
-
-type GenerateSystemdValues struct {
- PodmanCommand
- Name bool
- New bool
- Files bool
- RestartPolicy string
- StopTimeout uint
-}
-
-type HistoryValues struct {
- PodmanCommand
- Human bool
- NoTrunc bool
- Quiet bool
- Format string
-}
-type PruneImagesValues struct {
- PodmanCommand
- All bool
- Force bool
- Filter []string
-}
-
-type PruneContainersValues struct {
- PodmanCommand
- Force bool
- Filter []string
-}
-
-type PodPruneValues struct {
- PodmanCommand
- Force bool
-}
-
-type ImportValues struct {
- PodmanCommand
- Change []string
- Message string
- Quiet bool
-}
-
-type InfoValues struct {
- PodmanCommand
- Debug bool
- Format string
-}
-
-type InitValues struct {
- PodmanCommand
- All bool
- Latest bool
-}
-
-type InspectValues struct {
- PodmanCommand
- TypeObject string
- Format string
- Size bool
- Latest bool
-}
-
-type KillValues struct {
- PodmanCommand
- All bool
- Signal string
- Latest bool
-}
-
-type LoadValues struct {
- PodmanCommand
- Input string
- Quiet bool
- SignaturePolicy string
-}
-
-type LoginValues struct {
- PodmanCommand
- Password string
- StdinPassword bool
- Username string
- Authfile string
- CertDir string
- GetLogin bool
- TlsVerify bool
-}
-
-type LogoutValues struct {
- PodmanCommand
- Authfile string
- All bool
-}
-
-type LogsValues struct {
- PodmanCommand
- Details bool
- Follow bool
- Since string
- Tail int64
- Timestamps bool
- Latest bool
- UseName bool
-}
-
-type MountValues struct {
- PodmanCommand
- All bool
- Format string
- NoTrunc bool
- Latest bool
-}
-
-type NetworkCreateValues struct {
- PodmanCommand
- Driver string
- DisableDNS bool
- Gateway net.IP
- Internal bool
- IPamDriver string
- IPRange net.IPNet
- IPV6 bool
- Network net.IPNet
- MacVLAN string
-}
-
-type NetworkListValues struct {
- PodmanCommand
- Filter []string
- Quiet bool
-}
-
-type NetworkRmValues struct {
- PodmanCommand
- Force bool
-}
-
-type NetworkInspectValues struct {
- PodmanCommand
-}
-
-type PauseValues struct {
- PodmanCommand
- All bool
-}
-
-type HealthCheckValues struct {
- PodmanCommand
-}
-
-type KubePlayValues struct {
- PodmanCommand
- Authfile string
- CertDir string
- Creds string
- Network string
- Quiet bool
- SignaturePolicy string
- TlsVerify bool
- SeccompProfileRoot string
-}
-
-type PodCreateValues struct {
- PodmanCommand
- CgroupParent string
- Infra bool
- InfraImage string
- InfraCommand string
- LabelFile []string
- Labels []string
- Name string
- Hostname string
- PodIDFile string
- Publish []string
- Share string
-}
-
-type PodInspectValues struct {
- PodmanCommand
- Latest bool
-}
-
-type PodKillValues struct {
- PodmanCommand
- All bool
- Signal string
- Latest bool
-}
-
-type PodPauseValues struct {
- PodmanCommand
- All bool
- Latest bool
-}
-
-type PodPsValues struct {
- PodmanCommand
- CtrNames bool
- CtrIDs bool
- CtrStatus bool
- Filter string
- Format string
- Latest bool
- Namespace bool
- NoTrunc bool
- Quiet bool
- Sort string
-}
-
-type PodRestartValues struct {
- PodmanCommand
- All bool
- Latest bool
-}
-
-type PodRmValues struct {
- PodmanCommand
- All bool
- Ignore bool
- Force bool
- Latest bool
-}
-
-type PodStartValues struct {
- PodmanCommand
- All bool
- Latest bool
-}
-type PodStatsValues struct {
- PodmanCommand
- All bool
- NoStream bool
- NoReset bool
- Format string
- Latest bool
-}
-
-type PodStopValues struct {
- PodmanCommand
- All bool
- Ignore bool
- Latest bool
- Timeout uint
-}
-
-type PodTopValues struct {
- PodmanCommand
- Latest bool
- ListDescriptors bool
-}
-type PodUnpauseValues struct {
- PodmanCommand
- All bool
- Latest bool
-}
-
-type PortValues struct {
- PodmanCommand
- All bool
- Latest bool
-}
-
-type PsValues struct {
- PodmanCommand
- All bool
- Filter []string
- Format string
- Last int
- Latest bool
- Namespace bool
- NoTrunct bool
- Pod bool
- Quiet bool
- Size bool
- Sort string
- Sync bool
- Watch uint
-}
-
-type PullValues struct {
- PodmanCommand
- AllTags bool
- Authfile string
- CertDir string
- Creds string
- OverrideArch string
- OverrideOS string
- Quiet bool
- SignaturePolicy string
- TlsVerify bool
-}
-
-type PushValues struct {
- PodmanCommand
- Authfile string
- CertDir string
- Compress bool
- Creds string
- Digestfile string
- Format string
- Quiet bool
- RemoveSignatures bool
- SignBy string
- SignaturePolicy string
- TlsVerify bool
-}
-
-type RefreshValues struct {
- PodmanCommand
-}
-
-type RestartValues struct {
- PodmanCommand
- All bool
- AutoUpdate bool
- Latest bool
- Running bool
- Timeout uint
-}
-
-type RestoreValues struct {
- PodmanCommand
- All bool
- Keep bool
- Latest bool
- TcpEstablished bool
- Import string
- Name string
- IgnoreRootfs bool
- IgnoreStaticIP bool
- IgnoreStaticMAC bool
-}
-
-type RmValues struct {
- PodmanCommand
- All bool
- Force bool
- Ignore bool
- Latest bool
- Storage bool
- Volumes bool
- CIDFiles []string
-}
-
-type RmiValues struct {
- PodmanCommand
- All bool
- Force bool
-}
-
-type RunlabelValues struct {
- PodmanCommand
- Authfile string
- CertDir string
- Creds string
- Display bool
- Name string
- Opt1 string
- Opt2 string
- Opt3 string
- Quiet bool
- Replace bool
- SignaturePolicy string
- TlsVerify bool
-}
-type SaveValues struct {
- PodmanCommand
- Compress bool
- Format string
- Output string
- Quiet bool
-}
-
-type SearchValues struct {
- PodmanCommand
- Authfile string
- Filter []string
- Format string
- Limit int
- NoTrunc bool
- TlsVerify bool
-}
-
-type TrustValues struct {
- PodmanCommand
-}
-
-type SignValues struct {
- PodmanCommand
- Directory string
- SignBy string
- CertDir string
-}
-
-type StartValues struct {
- PodmanCommand
- Attach bool
- DetachKeys string
- Interactive bool
- Latest bool
- SigProxy bool
-}
-
-type StatsValues struct {
- PodmanCommand
- All bool
- Format string
- Latest bool
- NoReset bool
- NoStream bool
-}
-
-type StopValues struct {
- PodmanCommand
- All bool
- Ignore bool
- Latest bool
- Timeout uint
- CIDFiles []string
-}
-
-type TopValues struct {
- PodmanCommand
- Latest bool
- ListDescriptors bool
-}
-
-type UmountValues struct {
- PodmanCommand
- All bool
- Force bool
- Latest bool
-}
-
-type UnpauseValues struct {
- PodmanCommand
- All bool
-}
-
-type VarlinkValues struct {
- PodmanCommand
- Timeout int64
-}
-
-type ServiceValues struct {
- PodmanCommand
- Varlink bool
- Timeout int64
-}
-
-type SetTrustValues struct {
- PodmanCommand
- PolicyPath string
- PubKeysFile []string
- TrustType string
-}
-
-type ShowTrustValues struct {
- PodmanCommand
- Json bool
- PolicyPath string
- Raw bool
- RegistryPath string
-}
-
-type VersionValues struct {
- PodmanCommand
- Format string
-}
-
-type VolumeCreateValues struct {
- PodmanCommand
- Driver string
- Label []string
- Opt []string
-}
-type VolumeInspectValues struct {
- PodmanCommand
- All bool
- Format string
-}
-
-type VolumeLsValues struct {
- PodmanCommand
- Filter string
- Format string
- Quiet bool
-}
-
-type VolumePruneValues struct {
- PodmanCommand
- Force bool
-}
-
-type VolumeRmValues struct {
- PodmanCommand
- All bool
- Force bool
-}
-
-type CleanupValues struct {
- PodmanCommand
- All bool
- Latest bool
- Remove bool
- RemoveImage bool
-}
-
-type SystemPruneValues struct {
- PodmanCommand
- All bool
- Force bool
- Volume bool
-}
-
-type SystemResetValues struct {
- PodmanCommand
- Force bool
-}
-
-type SystemRenumberValues struct {
- PodmanCommand
-}
-
-type SystemMigrateValues struct {
- PodmanCommand
- NewRuntime string
-}
-
-type SystemDfValues struct {
- PodmanCommand
- Verbose bool
- Format string
-}
-
-type UntagValues struct {
- PodmanCommand
-}
-
-func GetDefaultConfig() *config.Config {
- var err error
- conf, err := config.NewConfig("")
- conf.CheckCgroupsAndAdjustConfig()
- if err != nil {
- logrus.Errorf("Error loading container config %v\n", err)
- os.Exit(1)
- }
- return conf
-}
diff --git a/cmd/podman/cliconfig/create.go b/cmd/podman/cliconfig/create.go
deleted file mode 100644
index c27dfbbee..000000000
--- a/cmd/podman/cliconfig/create.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package cliconfig
-
-import (
- buildahcli "github.com/containers/buildah/pkg/cli"
-)
-
-type CreateValues struct {
- PodmanCommand
-}
-
-type RunValues struct {
- PodmanCommand
-}
-
-// PodmanBuildResults represents the results for Podman Build flags
-// that are unique to Podman.
-type PodmanBuildResults struct {
- SquashAll bool
-}
-
-type BuildValues struct {
- PodmanCommand
- *buildahcli.BudResults
- *buildahcli.UserNSResults
- *buildahcli.FromAndBudResults
- *buildahcli.LayerResults
- *buildahcli.NameSpaceResults
- *PodmanBuildResults
-}
-
-type CpValues struct {
- PodmanCommand
- Extract bool
- Pause bool
-}
diff --git a/cmd/podman/cliconfig/defaults.go b/cmd/podman/cliconfig/defaults.go
deleted file mode 100644
index 3082207e0..000000000
--- a/cmd/podman/cliconfig/defaults.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package cliconfig
-
-var (
- // DefaultHealthCheckInterval default value
- DefaultHealthCheckInterval = "30s"
- // DefaultHealthCheckRetries default value
- DefaultHealthCheckRetries uint = 3
- // DefaultHealthCheckStartPeriod default value
- DefaultHealthCheckStartPeriod = "0s"
- // DefaultHealthCheckTimeout default value
- DefaultHealthCheckTimeout = "30s"
- // DefaultImageVolume default value
- DefaultImageVolume = "bind"
-)