summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/container.go3
-rw-r--r--pkg/specgen/generate/container_create.go3
-rw-r--r--pkg/specgen/generate/pod_create.go4
-rw-r--r--pkg/specgen/pod_validate.go3
-rw-r--r--pkg/specgen/podspecgen.go6
5 files changed, 15 insertions, 4 deletions
diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go
index ca92f558d..1f6d00eb7 100644
--- a/pkg/specgen/generate/container.go
+++ b/pkg/specgen/generate/container.go
@@ -26,8 +26,7 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
var inspectData *libimage.ImageData
var err error
if s.Image != "" {
- lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
- newImage, _, err = r.LibimageRuntime().LookupImage(s.Image, lookupOptions)
+ newImage, _, err = r.LibimageRuntime().LookupImage(s.Image, nil)
if err != nil {
return nil, err
}
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index e2901f0b6..b569f8390 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -92,8 +92,7 @@ func MakeContainer(ctx context.Context, rt *libpod.Runtime, s *specgen.SpecGener
options = append(options, libpod.WithRootFS(s.Rootfs))
} else {
var resolvedImageName string
- lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
- newImage, resolvedImageName, err = rt.LibimageRuntime().LookupImage(s.Image, lookupOptions)
+ newImage, resolvedImageName, err = rt.LibimageRuntime().LookupImage(s.Image, nil)
if err != nil {
return nil, err
}
diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go
index 4ffd8a37f..aab29499e 100644
--- a/pkg/specgen/generate/pod_create.go
+++ b/pkg/specgen/generate/pod_create.go
@@ -98,6 +98,10 @@ func createPodOptions(p *specgen.PodSpecGenerator, rt *libpod.Runtime) ([]libpod
options = append(options, libpod.WithInfraImage(p.InfraImage))
}
+ if len(p.InfraName) > 0 {
+ options = append(options, libpod.WithInfraName(p.InfraName))
+ }
+
if len(p.InfraCommand) > 0 {
options = append(options, libpod.WithInfraCommand(p.InfraCommand))
}
diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go
index c746bcd1a..bca7b6dbe 100644
--- a/pkg/specgen/pod_validate.go
+++ b/pkg/specgen/pod_validate.go
@@ -36,6 +36,9 @@ func (p *PodSpecGenerator) Validate() error {
if len(p.InfraImage) > 0 {
return exclusivePodOptions("NoInfra", "InfraImage")
}
+ if len(p.InfraName) > 0 {
+ return exclusivePodOptions("NoInfra", "InfraName")
+ }
if len(p.SharedNamespaces) > 0 {
return exclusivePodOptions("NoInfra", "SharedNamespaces")
}
diff --git a/pkg/specgen/podspecgen.go b/pkg/specgen/podspecgen.go
index 319345c71..02237afe9 100644
--- a/pkg/specgen/podspecgen.go
+++ b/pkg/specgen/podspecgen.go
@@ -43,6 +43,12 @@ type PodBasicConfig struct {
// Conflicts with NoInfra=true.
// Optional.
InfraImage string `json:"infra_image,omitempty"`
+ // InfraName is the name that will be used for the infra container.
+ // If not set, the default set in the Libpod configuration file will be
+ // used.
+ // Conflicts with NoInfra=true.
+ // Optional.
+ InfraName string `json:"infra_name,omitempty"`
// SharedNamespaces instructs the pod to share a set of namespaces.
// Shared namespaces will be joined (by default) by every container
// which joins the pod.