summaryrefslogtreecommitdiff
path: root/pkg/util/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/util/utils.go')
-rw-r--r--pkg/util/utils.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index 2500693d7..babf7dfc9 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -14,7 +14,6 @@ import (
"github.com/BurntSushi/toml"
"github.com/containers/image/v5/types"
- "github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/pkg/errorhandling"
"github.com/containers/libpod/pkg/namespaces"
"github.com/containers/libpod/pkg/rootless"
@@ -25,7 +24,6 @@ import (
"github.com/opencontainers/selinux/go-selinux"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
- "github.com/spf13/pflag"
"golang.org/x/crypto/ssh/terminal"
)
@@ -516,37 +514,6 @@ func ParseInputTime(inputTime string) (time.Time, error) {
return time.Now().Add(-duration), nil
}
-// GetGlobalOpts checks all global flags and generates the command string
-// FIXME: Port input to config.Config
-// TODO: Is there a "better" way to reverse values to flags? This seems brittle.
-func GetGlobalOpts(c *cliconfig.RunlabelValues) string {
- globalFlags := map[string]bool{
- "cgroup-manager": true, "cni-config-dir": true, "conmon": true, "default-mounts-file": true,
- "hooks-dir": true, "namespace": true, "root": true, "runroot": true,
- "runtime": true, "storage-driver": true, "storage-opt": true, "syslog": true,
- "trace": true, "network-cmd-path": true, "config": true, "cpu-profile": true,
- "log-level": true, "tmpdir": true}
- const stringSliceType string = "stringSlice"
-
- var optsCommand []string
- c.PodmanCommand.Command.Flags().VisitAll(func(f *pflag.Flag) {
- if !f.Changed {
- return
- }
- if _, exist := globalFlags[f.Name]; exist {
- if f.Value.Type() == stringSliceType {
- flagValue := strings.TrimSuffix(strings.TrimPrefix(f.Value.String(), "["), "]")
- for _, value := range strings.Split(flagValue, ",") {
- optsCommand = append(optsCommand, fmt.Sprintf("--%s %s", f.Name, value))
- }
- } else {
- optsCommand = append(optsCommand, fmt.Sprintf("--%s %s", f.Name, f.Value.String()))
- }
- }
- })
- return strings.Join(optsCommand, " ")
-}
-
// OpenExclusiveFile opens a file for writing and ensure it doesn't already exist
func OpenExclusiveFile(path string) (*os.File, error) {
baseDir := filepath.Dir(path)