summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-14 17:06:50 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-12-14 18:41:06 +0100
commit888c778ee975b449aef6dec6bbdfb029a7fe385e (patch)
treed53a9077a78838a28ae33a615e317d913b3c01b4 /cmd/podman
parentc501c1d6423759d9180bfe254d1bbe7662d89868 (diff)
downloadpodman-888c778ee975b449aef6dec6bbdfb029a7fe385e.tar.gz
podman-888c778ee975b449aef6dec6bbdfb029a7fe385e.tar.bz2
podman-888c778ee975b449aef6dec6bbdfb029a7fe385e.zip
fix network id handling
We have to get the network ID from the network backend. With the netavark backend we no longer use the sha from the name as ID. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/completion.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index cb3efe592..358533214 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"
@@ -256,12 +255,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) {