From 418dee100b9029bbc44141138bc3d03a66da4a99 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 26 Feb 2020 11:09:19 +0100 Subject: spec: allow container alias name in lookup Previously --uts=container: expected the full container ID. Closes: https://github.com/containers/libpod/issues/5289 Signed-off-by: Giuseppe Scrivano --- pkg/spec/namespaces.go | 2 +- pkg/specgen/namespaces.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/spec/namespaces.go b/pkg/spec/namespaces.go index 1f98e6e25..838d95c54 100644 --- a/pkg/spec/namespaces.go +++ b/pkg/spec/namespaces.go @@ -422,7 +422,7 @@ func (c *UtsConfig) ConfigureGenerator(g *generate.Generator, net *NetworkConfig if hostname == "" { switch { case utsCtrID != "": - utsCtr, err := runtime.GetContainer(utsCtrID) + utsCtr, err := runtime.LookupContainer(utsCtrID) if err != nil { return errors.Wrapf(err, "unable to retrieve hostname from dependency container %s", utsCtrID) } diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go index 025cb31e0..17b180cde 100644 --- a/pkg/specgen/namespaces.go +++ b/pkg/specgen/namespaces.go @@ -276,7 +276,7 @@ func (s *SpecGenerator) utsConfigureGenerator(g *generate.Generator, runtime *li if hostname == "" { switch { case s.UtsNS.IsContainer(): - utsCtr, err := runtime.GetContainer(s.UtsNS.Value) + utsCtr, err := runtime.LookupContainer(s.UtsNS.Value) if err != nil { return errors.Wrapf(err, "unable to retrieve hostname from dependency container %s", s.UtsNS.Value) } -- cgit v1.2.3-54-g00ecf