summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/images_history.go4
-rw-r--r--pkg/api/handlers/compat/images_tag.go4
-rw-r--r--pkg/api/handlers/libpod/images.go4
-rw-r--r--pkg/api/handlers/types.go1
-rw-r--r--pkg/api/handlers/utils/images.go3
-rw-r--r--pkg/domain/entities/pods.go2
-rw-r--r--pkg/domain/infra/abi/containers.go47
-rw-r--r--pkg/domain/infra/abi/images.go10
-rw-r--r--pkg/domain/infra/abi/manifest.go8
-rw-r--r--pkg/domain/infra/tunnel/containers.go26
-rw-r--r--pkg/ps/ps.go4
-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
-rw-r--r--pkg/systemd/generate/common.go2
-rw-r--r--pkg/systemd/generate/containers_test.go34
-rw-r--r--pkg/systemd/generate/pods_test.go10
19 files changed, 99 insertions, 79 deletions
diff --git a/pkg/api/handlers/compat/images_history.go b/pkg/api/handlers/compat/images_history.go
index ea596890f..54c893f47 100644
--- a/pkg/api/handlers/compat/images_history.go
+++ b/pkg/api/handlers/compat/images_history.go
@@ -3,7 +3,6 @@ package compat
import (
"net/http"
- "github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/pkg/api/handlers"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
@@ -14,8 +13,7 @@ func HistoryImage(w http.ResponseWriter, r *http.Request) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
name := utils.GetName(r)
- lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
- newImage, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions)
+ newImage, _, err := runtime.LibimageRuntime().LookupImage(name, nil)
if err != nil {
utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Wrapf(err, "failed to find image %s", name))
return
diff --git a/pkg/api/handlers/compat/images_tag.go b/pkg/api/handlers/compat/images_tag.go
index 8d256f4fa..199ad0488 100644
--- a/pkg/api/handlers/compat/images_tag.go
+++ b/pkg/api/handlers/compat/images_tag.go
@@ -4,7 +4,6 @@ import (
"fmt"
"net/http"
- "github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
"github.com/pkg/errors"
@@ -16,8 +15,7 @@ func TagImage(w http.ResponseWriter, r *http.Request) {
// /v1.xx/images/(name)/tag
name := utils.GetName(r)
- lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
- newImage, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions)
+ newImage, _, err := runtime.LibimageRuntime().LookupImage(name, nil)
if err != nil {
utils.ImageNotFound(w, name, errors.Wrapf(err, "failed to find image %s", name))
return
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index fc6ab4b4c..d759f4824 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -11,7 +11,6 @@ import (
"strings"
"github.com/containers/buildah"
- "github.com/containers/common/libimage"
"github.com/containers/common/pkg/filters"
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/types"
@@ -215,8 +214,7 @@ func ExportImage(w http.ResponseWriter, r *http.Request) {
}
name := utils.GetName(r)
- lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
- if _, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions); err != nil {
+ if _, _, err := runtime.LibimageRuntime().LookupImage(name, nil); err != nil {
utils.ImageNotFound(w, name, err)
return
}
diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go
index 59f948567..3cc10d70f 100644
--- a/pkg/api/handlers/types.go
+++ b/pkg/api/handlers/types.go
@@ -133,6 +133,7 @@ type PodCreateConfig struct {
Infra bool `json:"infra"`
InfraCommand string `json:"infra-command"`
InfraImage string `json:"infra-image"`
+ InfraName string `json:"infra-name"`
Labels []string `json:"labels"`
Publish []string `json:"publish"`
Share string `json:"share"`
diff --git a/pkg/api/handlers/utils/images.go b/pkg/api/handlers/utils/images.go
index 2a1908d63..1e8edb6dd 100644
--- a/pkg/api/handlers/utils/images.go
+++ b/pkg/api/handlers/utils/images.go
@@ -88,8 +88,7 @@ func GetImages(w http.ResponseWriter, r *http.Request) ([]*libimage.Image, error
func GetImage(r *http.Request, name string) (*libimage.Image, error) {
runtime := r.Context().Value("runtime").(*libpod.Runtime)
- lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
- image, _, err := runtime.LibimageRuntime().LookupImage(name, lookupOptions)
+ image, _, err := runtime.LibimageRuntime().LookupImage(name, nil)
if err != nil {
return nil, err
}
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index a0a2a1790..68e335f8d 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -112,6 +112,7 @@ type PodCreateOptions struct {
Hostname string
Infra bool
InfraImage string
+ InfraName string
InfraCommand string
InfraConmonPidFile string
Labels map[string]string
@@ -172,6 +173,7 @@ func (p *PodCreateOptions) ToPodSpecGen(s *specgen.PodSpecGenerator) error {
s.InfraConmonPidFile = p.InfraConmonPidFile
}
s.InfraImage = p.InfraImage
+ s.InfraName = p.InfraName
s.SharedNamespaces = p.Share
s.PodCreateCommand = p.CreateCommand
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 2c5300ccb..50751aa12 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -261,6 +261,24 @@ func (ic *ContainerEngine) ContainerRestart(ctx context.Context, namesOrIds []st
return reports, nil
}
+func (ic *ContainerEngine) removeContainer(ctx context.Context, ctr *libpod.Container, options entities.RmOptions) error {
+ err := ic.Libpod.RemoveContainer(ctx, ctr, options.Force, options.Volumes)
+ if err == nil {
+ return nil
+ }
+ logrus.Debugf("Failed to remove container %s: %s", ctr.ID(), err.Error())
+ switch errors.Cause(err) {
+ case define.ErrNoSuchCtr:
+ if options.Ignore {
+ logrus.Debugf("Ignoring error (--allow-missing): %v", err)
+ return nil
+ }
+ case define.ErrCtrRemoved:
+ return nil
+ }
+ return err
+}
+
func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string, options entities.RmOptions) ([]*entities.RmReport, error) {
reports := []*entities.RmReport{}
@@ -318,21 +336,7 @@ func (ic *ContainerEngine) ContainerRm(ctx context.Context, namesOrIds []string,
}
errMap, err := parallelctr.ContainerOp(ctx, ctrs, func(c *libpod.Container) error {
- err := ic.Libpod.RemoveContainer(ctx, c, options.Force, options.Volumes)
- if err == nil {
- return nil
- }
- logrus.Debugf("Failed to remove container %s: %s", c.ID(), err.Error())
- switch errors.Cause(err) {
- case define.ErrNoSuchCtr:
- if options.Ignore {
- logrus.Debugf("Ignoring error (--allow-missing): %v", err)
- return nil
- }
- case define.ErrCtrRemoved:
- return nil
- }
- return err
+ return ic.removeContainer(ctx, c, options)
})
if err != nil {
return nil, err
@@ -791,6 +795,11 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri
Err: err,
ExitCode: exitCode,
})
+ if ctr.AutoRemove() {
+ if err := ic.removeContainer(ctx, ctr, entities.RmOptions{}); err != nil {
+ logrus.Errorf("Error removing container %s: %v", ctr.ID(), err)
+ }
+ }
return reports, errors.Wrapf(err, "unable to start container %s", ctr.ID())
}
@@ -827,9 +836,6 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri
ExitCode: 125,
}
if err := ctr.Start(ctx, true); err != nil {
- // if lastError != nil {
- // fmt.Fprintln(os.Stderr, lastError)
- // }
report.Err = err
if errors.Cause(err) == define.ErrWillDeadlock {
report.Err = errors.Wrapf(err, "please run 'podman system renumber' to resolve deadlocks")
@@ -838,6 +844,11 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri
}
report.Err = errors.Wrapf(err, "unable to start container %q", ctr.ID())
reports = append(reports, report)
+ if ctr.AutoRemove() {
+ if err := ic.removeContainer(ctx, ctr, entities.RmOptions{}); err != nil {
+ logrus.Errorf("Error removing container %s: %v", ctr.ID(), err)
+ }
+ }
continue
}
report.ExitCode = 0
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 6d1acb590..e8739615d 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -89,7 +89,7 @@ func toDomainHistoryLayer(layer *libimage.ImageHistory) entities.ImageHistoryLay
}
func (ir *ImageEngine) History(ctx context.Context, nameOrID string, opts entities.ImageHistoryOptions) (*entities.ImageHistoryReport, error) {
- image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
+ image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return nil, err
}
@@ -245,7 +245,7 @@ func (ir *ImageEngine) Inspect(ctx context.Context, namesOrIDs []string, opts en
reports := []*entities.ImageInspectReport{}
errs := []error{}
for _, i := range namesOrIDs {
- img, _, err := ir.Libpod.LibimageRuntime().LookupImage(i, &libimage.LookupImageOptions{IgnorePlatform: true})
+ img, _, err := ir.Libpod.LibimageRuntime().LookupImage(i, nil)
if err != nil {
// This is probably a no such image, treat as nonfatal.
errs = append(errs, err)
@@ -321,7 +321,7 @@ func (ir *ImageEngine) Push(ctx context.Context, source string, destination stri
}
func (ir *ImageEngine) Tag(ctx context.Context, nameOrID string, tags []string, options entities.ImageTagOptions) error {
- image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
+ image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return err
}
@@ -334,7 +334,7 @@ func (ir *ImageEngine) Tag(ctx context.Context, nameOrID string, tags []string,
}
func (ir *ImageEngine) Untag(ctx context.Context, nameOrID string, tags []string, options entities.ImageUntagOptions) error {
- image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
+ image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return err
}
@@ -454,7 +454,7 @@ func (ir *ImageEngine) Build(ctx context.Context, containerFiles []string, opts
}
func (ir *ImageEngine) Tree(ctx context.Context, nameOrID string, opts entities.ImageTreeOptions) (*entities.ImageTreeReport, error) {
- image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, &libimage.LookupImageOptions{IgnorePlatform: true})
+ image, _, err := ir.Libpod.LibimageRuntime().LookupImage(nameOrID, nil)
if err != nil {
return nil, err
}
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go
index e905036be..68e29f006 100644
--- a/pkg/domain/infra/abi/manifest.go
+++ b/pkg/domain/infra/abi/manifest.go
@@ -47,7 +47,7 @@ func (ir *ImageEngine) ManifestCreate(ctx context.Context, names []string, image
// ManifestExists checks if a manifest list with the given name exists in local storage
func (ir *ImageEngine) ManifestExists(ctx context.Context, name string) (*entities.BoolReport, error) {
- image, _, err := ir.Libpod.LibimageRuntime().LookupImage(name, &libimage.LookupImageOptions{IgnorePlatform: true})
+ _, err := ir.Libpod.LibimageRuntime().LookupManifestList(name)
if err != nil {
if errors.Cause(err) == storage.ErrImageUnknown {
return &entities.BoolReport{Value: false}, nil
@@ -55,11 +55,7 @@ func (ir *ImageEngine) ManifestExists(ctx context.Context, name string) (*entiti
return nil, err
}
- isManifestList, err := image.IsManifestList(ctx)
- if err != nil {
- return nil, err
- }
- return &entities.BoolReport{Value: isManifestList}, nil
+ return &entities.BoolReport{Value: true}, nil
}
// ManifestInspect returns the content of a manifest list or image
diff --git a/pkg/domain/infra/tunnel/containers.go b/pkg/domain/infra/tunnel/containers.go
index 56315f46f..c17d7b54f 100644
--- a/pkg/domain/infra/tunnel/containers.go
+++ b/pkg/domain/infra/tunnel/containers.go
@@ -541,6 +541,17 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri
return nil, err
}
removeOptions := new(containers.RemoveOptions).WithVolumes(true).WithForce(false)
+ removeContainer := func(id string) {
+ if err := containers.Remove(ic.ClientCtx, id, removeOptions); err != nil {
+ if errorhandling.Contains(err, define.ErrNoSuchCtr) ||
+ errorhandling.Contains(err, define.ErrCtrRemoved) {
+ logrus.Debugf("Container %s does not exist: %v", id, err)
+ } else {
+ logrus.Errorf("Error removing container %s: %v", id, err)
+ }
+ }
+ }
+
// There can only be one container if attach was used
for i, ctr := range ctrs {
name := ctr.ID
@@ -568,6 +579,9 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri
}
if err != nil {
+ if ctr.AutoRemove {
+ removeContainer(ctr.ID)
+ }
report.ExitCode = define.ExitCode(report.Err)
report.Err = err
reports = append(reports, &report)
@@ -582,16 +596,10 @@ func (ic *ContainerEngine) ContainerStart(ctx context.Context, namesOrIds []stri
logrus.Errorf("Failed to check if %s should restart: %v", ctr.ID, err)
return
}
+ logrus.Errorf("Should restart: %v", shouldRestart)
- if !shouldRestart {
- if err := containers.Remove(ic.ClientCtx, ctr.ID, removeOptions); err != nil {
- if errorhandling.Contains(err, define.ErrNoSuchCtr) ||
- errorhandling.Contains(err, define.ErrCtrRemoved) {
- logrus.Debugf("Container %s does not exist: %v", ctr.ID, err)
- } else {
- logrus.Errorf("Error removing container %s: %v", ctr.ID, err)
- }
- }
+ if !shouldRestart && ctr.AutoRemove {
+ removeContainer(ctr.ID)
}
}()
}
diff --git a/pkg/ps/ps.go b/pkg/ps/ps.go
index ef79973d6..54079baa1 100644
--- a/pkg/ps/ps.go
+++ b/pkg/ps/ps.go
@@ -9,7 +9,6 @@ import (
"strings"
"time"
- "github.com/containers/common/libimage"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/domain/entities"
@@ -272,8 +271,7 @@ func ListStorageContainer(rt *libpod.Runtime, ctr storage.Container) (entities.L
imageName := ""
if ctr.ImageID != "" {
- lookupOptions := &libimage.LookupImageOptions{IgnorePlatform: true}
- image, _, err := rt.LibimageRuntime().LookupImage(ctr.ImageID, lookupOptions)
+ image, _, err := rt.LibimageRuntime().LookupImage(ctr.ImageID, nil)
if err != nil {
return ps, err
}
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.
diff --git a/pkg/systemd/generate/common.go b/pkg/systemd/generate/common.go
index e183125a7..349805980 100644
--- a/pkg/systemd/generate/common.go
+++ b/pkg/systemd/generate/common.go
@@ -34,7 +34,7 @@ const headerTemplate = `# {{{{.ServiceName}}}}.service
[Unit]
Description=Podman {{{{.ServiceName}}}}.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor={{{{.RunRoot}}}}
`
diff --git a/pkg/systemd/generate/containers_test.go b/pkg/systemd/generate/containers_test.go
index 12a8f3004..1d24cc4a9 100644
--- a/pkg/systemd/generate/containers_test.go
+++ b/pkg/systemd/generate/containers_test.go
@@ -46,7 +46,7 @@ func TestCreateContainerSystemdUnit(t *testing.T) {
[Unit]
Description=Podman container-639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -72,7 +72,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman container-foobar.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -96,7 +96,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman container-foobar.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
BindsTo=a.service b.service c.service pod.service
@@ -122,7 +122,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -144,7 +144,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -166,7 +166,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -188,7 +188,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -210,7 +210,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman container-639c53578af4d84b8800b4635fa4e680ee80fd67e0e6a2d4eea48d1e3230f401.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -233,7 +233,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -259,7 +259,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -281,7 +281,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -303,7 +303,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -325,7 +325,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -347,7 +347,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -369,7 +369,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -391,7 +391,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
@@ -413,7 +413,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman jadda-jadda.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
diff --git a/pkg/systemd/generate/pods_test.go b/pkg/systemd/generate/pods_test.go
index a11e1e11e..4b8a9ffd5 100644
--- a/pkg/systemd/generate/pods_test.go
+++ b/pkg/systemd/generate/pods_test.go
@@ -45,7 +45,7 @@ func TestCreatePodSystemdUnit(t *testing.T) {
[Unit]
Description=Podman pod-123abc.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
Requires=container-1.service container-2.service
@@ -73,7 +73,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman pod-123abc.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
Requires=container-1.service container-2.service
@@ -101,7 +101,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman pod-123abc.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
Requires=container-1.service container-2.service
@@ -129,7 +129,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman pod-123abc.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
Requires=container-1.service container-2.service
@@ -157,7 +157,7 @@ WantedBy=multi-user.target default.target
[Unit]
Description=Podman pod-123abc.service
Documentation=man:podman-generate-systemd(1)
-Wants=network.target
+Wants=network-online.target
After=network-online.target
RequiresMountsFor=/var/run/containers/storage
Requires=container-1.service container-2.service