aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/common/completion.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-12 12:36:20 +0200
committerGitHub <noreply@github.com>2021-04-12 12:36:20 +0200
commit9d3e31071087908207a8f7fdc84939edf3dc47c0 (patch)
tree7993a84a9b70504b2a99c88085e5e7205bc0b94b /cmd/podman/common/completion.go
parent3b03ff7d1ea65c31ca8c9a28e70f7dd5a43afbf0 (diff)
parent61cb6d61dd420a000c843171b5917b5595874a67 (diff)
downloadpodman-9d3e31071087908207a8f7fdc84939edf3dc47c0.tar.gz
podman-9d3e31071087908207a8f7fdc84939edf3dc47c0.tar.bz2
podman-9d3e31071087908207a8f7fdc84939edf3dc47c0.zip
Merge pull request #9935 from EduardoVega/5788-kube-volume
Add support for play/generate kube PersistentVolumeClaims and Podman volumes
Diffstat (limited to 'cmd/podman/common/completion.go')
-rw-r--r--cmd/podman/common/completion.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index bc106263c..d110fb1b5 100644
--- a/cmd/podman/common/completion.go
+++ b/cmd/podman/common/completion.go
@@ -405,6 +405,20 @@ func AutocompletePodsRunning(cmd *cobra.Command, args []string, toComplete strin
return getPods(cmd, toComplete, completeDefault, "running", "degraded")
}
+// AutocompleteForKube - Autocomplete all Podman objects supported by kube generate.
+func AutocompleteForKube(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
+ if !validCurrentCmdLine(cmd, args, toComplete) {
+ return nil, cobra.ShellCompDirectiveNoFileComp
+ }
+ containers, _ := getContainers(cmd, toComplete, completeDefault)
+ pods, _ := getPods(cmd, toComplete, completeDefault)
+ volumes, _ := getVolumes(cmd, toComplete)
+ objs := containers
+ objs = append(objs, pods...)
+ objs = append(objs, volumes...)
+ return objs, cobra.ShellCompDirectiveNoFileComp
+}
+
// AutocompleteContainersAndPods - Autocomplete container names and pod names.
func AutocompleteContainersAndPods(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
if !validCurrentCmdLine(cmd, args, toComplete) {