diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/machine/list.go | 20 | ||||
-rw-r--r-- | cmd/podman/play/kube.go | 6 |
2 files changed, 16 insertions, 10 deletions
diff --git a/cmd/podman/machine/list.go b/cmd/podman/machine/list.go index ef26b7886..5254d50cf 100644 --- a/cmd/podman/machine/list.go +++ b/cmd/podman/machine/list.go @@ -43,7 +43,7 @@ type listFlagType struct { quiet bool } -type machineReporter struct { +type ListReporter struct { Name string Default bool Created string @@ -68,7 +68,7 @@ func init() { flags := lsCmd.Flags() formatFlagName := "format" flags.StringVar(&listFlag.format, formatFlagName, "{{.Name}}\t{{.VMType}}\t{{.Created}}\t{{.LastUp}}\t{{.CPUs}}\t{{.Memory}}\t{{.DiskSize}}\n", "Format volume output using JSON or a Go template") - _ = lsCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&machineReporter{})) + _ = lsCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(&ListReporter{})) flags.BoolVar(&listFlag.noHeading, "noheading", false, "Do not print headers") flags.BoolVarP(&listFlag.quiet, "quiet", "q", false, "Show only machine names") } @@ -121,8 +121,8 @@ func list(cmd *cobra.Command, args []string) error { return outputTemplate(cmd, machineReporter) } -func outputTemplate(cmd *cobra.Command, responses []*machineReporter) error { - headers := report.Headers(machineReporter{}, map[string]string{ +func outputTemplate(cmd *cobra.Command, responses []*ListReporter) error { + headers := report.Headers(ListReporter{}, map[string]string{ "LastUp": "LAST UP", "VmType": "VM TYPE", "CPUs": "CPUS", @@ -181,15 +181,15 @@ func streamName(imageStream string) string { return imageStream } -func toMachineFormat(vms []*machine.ListResponse) ([]*machineReporter, error) { +func toMachineFormat(vms []*machine.ListResponse) ([]*ListReporter, error) { cfg, err := config.ReadCustomConfig() if err != nil { return nil, err } - machineResponses := make([]*machineReporter, 0, len(vms)) + machineResponses := make([]*ListReporter, 0, len(vms)) for _, vm := range vms { - response := new(machineReporter) + response := new(ListReporter) response.Default = vm.Name == cfg.Engine.ActiveService response.Name = vm.Name response.Running = vm.Running @@ -209,15 +209,15 @@ func toMachineFormat(vms []*machine.ListResponse) ([]*machineReporter, error) { return machineResponses, nil } -func toHumanFormat(vms []*machine.ListResponse) ([]*machineReporter, error) { +func toHumanFormat(vms []*machine.ListResponse) ([]*ListReporter, error) { cfg, err := config.ReadCustomConfig() if err != nil { return nil, err } - humanResponses := make([]*machineReporter, 0, len(vms)) + humanResponses := make([]*ListReporter, 0, len(vms)) for _, vm := range vms { - response := new(machineReporter) + response := new(ListReporter) if vm.Name == cfg.Engine.ActiveService { response.Name = vm.Name + "*" response.Default = true diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go index 3be7396ce..5fe059139 100644 --- a/cmd/podman/play/kube.go +++ b/cmd/podman/play/kube.go @@ -98,6 +98,12 @@ func init() { ) _ = kubeCmd.RegisterFlagCompletionFunc(logOptFlagName, common.AutocompleteLogOpt) + usernsFlagName := "userns" + flags.StringVar(&kubeOptions.Userns, usernsFlagName, os.Getenv("PODMAN_USERNS"), + "User namespace to use", + ) + _ = kubeCmd.RegisterFlagCompletionFunc(usernsFlagName, common.AutocompleteUserNamespace) + flags.BoolVar(&kubeOptions.NoHosts, "no-hosts", false, "Do not create /etc/hosts within the pod's containers, instead use the version from the image") flags.BoolVarP(&kubeOptions.Quiet, "quiet", "q", false, "Suppress output information when pulling images") flags.BoolVar(&kubeOptions.TLSVerifyCLI, "tls-verify", true, "Require HTTPS and verify certificates when contacting registries") |