aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/pods
diff options
context:
space:
mode:
authorUrvashi Mohnani <umohnani@redhat.com>2022-05-25 16:50:16 -0400
committerUrvashi Mohnani <umohnani@redhat.com>2022-05-26 11:12:40 -0400
commit426a07e7008f539825abe74484296cfaf4399ad8 (patch)
tree5e735bd7fd41637c14ceacd6959eff8ddc3a262b /cmd/podman/pods
parente11feb230923a169c1e235552afa2f7bec7f0fff (diff)
downloadpodman-426a07e7008f539825abe74484296cfaf4399ad8.tar.gz
podman-426a07e7008f539825abe74484296cfaf4399ad8.tar.bz2
podman-426a07e7008f539825abe74484296cfaf4399ad8.zip
Combine the CheckAllLatest CID and PodID functions
These two functions were doing the exact same thing just with cidfile and pod-id-file separately. Combine the functionality to one function to remove repetative code. Fix the TODO in cmd/podman/validate/args.go [NO NEW TESTS NEEDED] Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Diffstat (limited to 'cmd/podman/pods')
-rw-r--r--cmd/podman/pods/kill.go2
-rw-r--r--cmd/podman/pods/pause.go2
-rw-r--r--cmd/podman/pods/restart.go2
-rw-r--r--cmd/podman/pods/rm.go2
-rw-r--r--cmd/podman/pods/start.go2
-rw-r--r--cmd/podman/pods/stop.go2
-rw-r--r--cmd/podman/pods/unpause.go2
7 files changed, 7 insertions, 7 deletions
diff --git a/cmd/podman/pods/kill.go b/cmd/podman/pods/kill.go
index 7216e08bb..5d3b15dc3 100644
--- a/cmd/podman/pods/kill.go
+++ b/cmd/podman/pods/kill.go
@@ -22,7 +22,7 @@ var (
Long: podKillDescription,
RunE: kill,
Args: func(cmd *cobra.Command, args []string) error {
- return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
+ return validate.CheckAllLatestAndIDFile(cmd, args, false, "")
},
ValidArgsFunction: common.AutocompletePodsRunning,
Example: `podman pod kill podID
diff --git a/cmd/podman/pods/pause.go b/cmd/podman/pods/pause.go
index adc54d171..389fb8415 100644
--- a/cmd/podman/pods/pause.go
+++ b/cmd/podman/pods/pause.go
@@ -22,7 +22,7 @@ var (
Long: podPauseDescription,
RunE: pause,
Args: func(cmd *cobra.Command, args []string) error {
- return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
+ return validate.CheckAllLatestAndIDFile(cmd, args, false, "")
},
ValidArgsFunction: common.AutocompletePodsRunning,
Example: `podman pod pause podID1 podID2
diff --git a/cmd/podman/pods/restart.go b/cmd/podman/pods/restart.go
index 6d624806a..a8e31ce07 100644
--- a/cmd/podman/pods/restart.go
+++ b/cmd/podman/pods/restart.go
@@ -22,7 +22,7 @@ var (
Long: podRestartDescription,
RunE: restart,
Args: func(cmd *cobra.Command, args []string) error {
- return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
+ return validate.CheckAllLatestAndIDFile(cmd, args, false, "")
},
ValidArgsFunction: common.AutocompletePods,
Example: `podman pod restart podID1 podID2
diff --git a/cmd/podman/pods/rm.go b/cmd/podman/pods/rm.go
index 52a815534..16b7191c9 100644
--- a/cmd/podman/pods/rm.go
+++ b/cmd/podman/pods/rm.go
@@ -35,7 +35,7 @@ var (
Long: podRmDescription,
RunE: rm,
Args: func(cmd *cobra.Command, args []string) error {
- return validate.CheckAllLatestAndPodIDFile(cmd, args, false, true)
+ return validate.CheckAllLatestAndIDFile(cmd, args, false, "pod-id-file")
},
ValidArgsFunction: common.AutocompletePods,
Example: `podman pod rm mywebserverpod
diff --git a/cmd/podman/pods/start.go b/cmd/podman/pods/start.go
index b668cdd61..9436d34a5 100644
--- a/cmd/podman/pods/start.go
+++ b/cmd/podman/pods/start.go
@@ -31,7 +31,7 @@ var (
Long: podStartDescription,
RunE: start,
Args: func(cmd *cobra.Command, args []string) error {
- return validate.CheckAllLatestAndPodIDFile(cmd, args, false, true)
+ return validate.CheckAllLatestAndIDFile(cmd, args, false, "pod-id-file")
},
ValidArgsFunction: common.AutocompletePods,
Example: `podman pod start podID
diff --git a/cmd/podman/pods/stop.go b/cmd/podman/pods/stop.go
index c8c3d2732..e8f82bee9 100644
--- a/cmd/podman/pods/stop.go
+++ b/cmd/podman/pods/stop.go
@@ -36,7 +36,7 @@ var (
Long: podStopDescription,
RunE: stop,
Args: func(cmd *cobra.Command, args []string) error {
- return validate.CheckAllLatestAndPodIDFile(cmd, args, false, true)
+ return validate.CheckAllLatestAndIDFile(cmd, args, false, "pod-id-file")
},
ValidArgsFunction: common.AutocompletePodsRunning,
Example: `podman pod stop mywebserverpod
diff --git a/cmd/podman/pods/unpause.go b/cmd/podman/pods/unpause.go
index a308a82c3..8a0a24e98 100644
--- a/cmd/podman/pods/unpause.go
+++ b/cmd/podman/pods/unpause.go
@@ -22,7 +22,7 @@ var (
Long: podUnpauseDescription,
RunE: unpause,
Args: func(cmd *cobra.Command, args []string) error {
- return validate.CheckAllLatestAndCIDFile(cmd, args, false, false)
+ return validate.CheckAllLatestAndIDFile(cmd, args, false, "")
},
// TODO have a function which shows only pods which could be unpaused
// for now show all