diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-14 20:56:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-14 20:56:55 +0100 |
commit | c36fb8b1138b112ec3d53e5cf89a2fbcb12e6840 (patch) | |
tree | d81ca6337af0e83f6bfc127c1296103a47f95046 /cmd/podman/common | |
parent | a0894b5ecd6c64d30b82a7b79bc1e2e87c7f0a4e (diff) | |
parent | 888c778ee975b449aef6dec6bbdfb029a7fe385e (diff) | |
download | podman-c36fb8b1138b112ec3d53e5cf89a2fbcb12e6840.tar.gz podman-c36fb8b1138b112ec3d53e5cf89a2fbcb12e6840.tar.bz2 podman-c36fb8b1138b112ec3d53e5cf89a2fbcb12e6840.zip |
Merge pull request #12595 from Luap99/network-id
fix network id handling
Diffstat (limited to 'cmd/podman/common')
-rw-r--r-- | cmd/podman/common/completion.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index f26e1d340..f1dea4113 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -13,7 +13,6 @@ import ( "github.com/containers/podman/v3/libpod/define" "github.com/containers/podman/v3/libpod/network/types" "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/containers/podman/v3/pkg/network" "github.com/containers/podman/v3/pkg/rootless" systemdDefine "github.com/containers/podman/v3/pkg/systemd/define" "github.com/containers/podman/v3/pkg/util" @@ -262,12 +261,11 @@ func getNetworks(cmd *cobra.Command, toComplete string, cType completeType) ([]s } for _, n := range networks { - id := network.GetNetworkID(n.Name) // include ids in suggestions if cType == completeIDs or // more then 2 chars are typed and cType == completeDefault if ((len(toComplete) > 1 && cType == completeDefault) || - cType == completeIDs) && strings.HasPrefix(id, toComplete) { - suggestions = append(suggestions, id[0:12]) + cType == completeIDs) && strings.HasPrefix(n.ID, toComplete) { + suggestions = append(suggestions, n.ID[0:12]) } // include name in suggestions if cType != completeIDs && strings.HasPrefix(n.Name, toComplete) { |