diff options
Diffstat (limited to 'pkg/domain/infra/abi')
24 files changed, 243 insertions, 139 deletions
diff --git a/pkg/domain/infra/abi/auto-update.go b/pkg/domain/infra/abi/auto-update.go index 7bbcde359..e8e2fa185 100644 --- a/pkg/domain/infra/abi/auto-update.go +++ b/pkg/domain/infra/abi/auto-update.go @@ -3,8 +3,8 @@ package abi import ( "context" - "github.com/containers/libpod/v2/pkg/autoupdate" - "github.com/containers/libpod/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/autoupdate" + "github.com/containers/podman/v2/pkg/domain/entities" ) func (ic *ContainerEngine) AutoUpdate(ctx context.Context, options entities.AutoUpdateOptions) (*entities.AutoUpdateReport, []error) { diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index 8909f831d..3fee5d394 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -13,22 +13,22 @@ import ( "github.com/containers/buildah" "github.com/containers/common/pkg/config" "github.com/containers/image/v5/manifest" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/libpod/define" - "github.com/containers/libpod/v2/libpod/events" - lpfilters "github.com/containers/libpod/v2/libpod/filters" - "github.com/containers/libpod/v2/libpod/image" - "github.com/containers/libpod/v2/libpod/logs" - "github.com/containers/libpod/v2/pkg/cgroups" - "github.com/containers/libpod/v2/pkg/checkpoint" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/domain/infra/abi/terminal" - "github.com/containers/libpod/v2/pkg/parallel" - "github.com/containers/libpod/v2/pkg/ps" - "github.com/containers/libpod/v2/pkg/rootless" - "github.com/containers/libpod/v2/pkg/signal" - "github.com/containers/libpod/v2/pkg/specgen" - "github.com/containers/libpod/v2/pkg/specgen/generate" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v2/libpod/events" + lpfilters "github.com/containers/podman/v2/libpod/filters" + "github.com/containers/podman/v2/libpod/image" + "github.com/containers/podman/v2/libpod/logs" + "github.com/containers/podman/v2/pkg/cgroups" + "github.com/containers/podman/v2/pkg/checkpoint" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/infra/abi/terminal" + "github.com/containers/podman/v2/pkg/parallel" + "github.com/containers/podman/v2/pkg/ps" + "github.com/containers/podman/v2/pkg/rootless" + "github.com/containers/podman/v2/pkg/signal" + "github.com/containers/podman/v2/pkg/specgen" + "github.com/containers/podman/v2/pkg/specgen/generate" "github.com/containers/storage" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/domain/infra/abi/containers_runlabel.go b/pkg/domain/infra/abi/containers_runlabel.go index 2e7d23d7e..ab2316d47 100644 --- a/pkg/domain/infra/abi/containers_runlabel.go +++ b/pkg/domain/infra/abi/containers_runlabel.go @@ -8,12 +8,12 @@ import ( "strings" "github.com/containers/image/v5/types" - "github.com/containers/libpod/v2/libpod/define" - "github.com/containers/libpod/v2/libpod/image" - "github.com/containers/libpod/v2/pkg/domain/entities" - envLib "github.com/containers/libpod/v2/pkg/env" - "github.com/containers/libpod/v2/pkg/util" - "github.com/containers/libpod/v2/utils" + "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v2/libpod/image" + "github.com/containers/podman/v2/pkg/domain/entities" + envLib "github.com/containers/podman/v2/pkg/env" + "github.com/containers/podman/v2/pkg/util" + "github.com/containers/podman/v2/utils" "github.com/google/shlex" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/domain/infra/abi/cp.go b/pkg/domain/infra/abi/cp.go index baed4df7a..0cd2ac8ca 100644 --- a/pkg/domain/infra/abi/cp.go +++ b/pkg/domain/infra/abi/cp.go @@ -11,9 +11,9 @@ import ( "github.com/containers/buildah/pkg/chrootuser" "github.com/containers/buildah/util" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/libpod/define" - "github.com/containers/libpod/v2/pkg/domain/entities" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v2/pkg/domain/entities" "github.com/containers/storage" "github.com/containers/storage/pkg/chrootarchive" "github.com/containers/storage/pkg/idtools" diff --git a/pkg/domain/infra/abi/events.go b/pkg/domain/infra/abi/events.go index 7a8185445..fa57543bf 100644 --- a/pkg/domain/infra/abi/events.go +++ b/pkg/domain/infra/abi/events.go @@ -3,8 +3,8 @@ package abi import ( "context" - "github.com/containers/libpod/v2/libpod/events" - "github.com/containers/libpod/v2/pkg/domain/entities" + "github.com/containers/podman/v2/libpod/events" + "github.com/containers/podman/v2/pkg/domain/entities" ) func (ic *ContainerEngine) Events(ctx context.Context, opts entities.EventsOptions) error { diff --git a/pkg/domain/infra/abi/generate.go b/pkg/domain/infra/abi/generate.go index 560be988b..93c4ede49 100644 --- a/pkg/domain/infra/abi/generate.go +++ b/pkg/domain/infra/abi/generate.go @@ -5,10 +5,10 @@ import ( "context" "fmt" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/libpod/define" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/systemd/generate" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/systemd/generate" "github.com/ghodss/yaml" "github.com/pkg/errors" k8sAPI "k8s.io/api/core/v1" diff --git a/pkg/domain/infra/abi/healthcheck.go b/pkg/domain/infra/abi/healthcheck.go index 4d834550f..49b709f39 100644 --- a/pkg/domain/infra/abi/healthcheck.go +++ b/pkg/domain/infra/abi/healthcheck.go @@ -3,8 +3,8 @@ package abi import ( "context" - "github.com/containers/libpod/v2/libpod/define" - "github.com/containers/libpod/v2/pkg/domain/entities" + "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v2/pkg/domain/entities" ) func (ic *ContainerEngine) HealthCheckRun(ctx context.Context, nameOrID string, options entities.HealthCheckOptions) (*define.HealthCheckResults, error) { diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index 3393275b8..05adc40fe 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -11,8 +11,6 @@ import ( "strconv" "strings" - "github.com/containers/libpod/v2/pkg/rootless" - "github.com/containers/common/pkg/config" "github.com/containers/image/v5/docker" dockerarchive "github.com/containers/image/v5/docker/archive" @@ -22,13 +20,14 @@ import ( "github.com/containers/image/v5/transports" "github.com/containers/image/v5/transports/alltransports" "github.com/containers/image/v5/types" - "github.com/containers/libpod/v2/libpod/define" - "github.com/containers/libpod/v2/libpod/image" - libpodImage "github.com/containers/libpod/v2/libpod/image" - "github.com/containers/libpod/v2/pkg/domain/entities" - domainUtils "github.com/containers/libpod/v2/pkg/domain/utils" - "github.com/containers/libpod/v2/pkg/trust" - "github.com/containers/libpod/v2/pkg/util" + "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v2/libpod/image" + libpodImage "github.com/containers/podman/v2/libpod/image" + "github.com/containers/podman/v2/pkg/domain/entities" + domainUtils "github.com/containers/podman/v2/pkg/domain/utils" + "github.com/containers/podman/v2/pkg/rootless" + "github.com/containers/podman/v2/pkg/trust" + "github.com/containers/podman/v2/pkg/util" "github.com/containers/storage" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" @@ -85,6 +84,125 @@ func (ir *ImageEngine) History(ctx context.Context, nameOrID string, opts entiti return &history, nil } +func (ir *ImageEngine) Mount(ctx context.Context, nameOrIDs []string, opts entities.ImageMountOptions) ([]*entities.ImageMountReport, error) { + var ( + images []*image.Image + err error + ) + if os.Geteuid() != 0 { + if driver := ir.Libpod.StorageConfig().GraphDriverName; driver != "vfs" { + // Do not allow to mount a graphdriver that is not vfs if we are creating the userns as part + // of the mount command. + return nil, errors.Errorf("cannot mount using driver %s in rootless mode", driver) + } + + became, ret, err := rootless.BecomeRootInUserNS("") + if err != nil { + return nil, err + } + if became { + os.Exit(ret) + } + } + if opts.All { + allImages, err := ir.Libpod.ImageRuntime().GetImages() + if err != nil { + return nil, err + } + for _, img := range allImages { + if !img.IsReadOnly() { + images = append(images, img) + } + } + } else { + for _, i := range nameOrIDs { + img, err := ir.Libpod.ImageRuntime().NewFromLocal(i) + if err != nil { + return nil, err + } + images = append(images, img) + } + } + reports := make([]*entities.ImageMountReport, 0, len(images)) + for _, img := range images { + report := entities.ImageMountReport{Id: img.ID()} + if img.IsReadOnly() { + report.Err = errors.Errorf("mounting readonly %s image not supported", img.ID()) + } else { + report.Path, report.Err = img.Mount([]string{}, "") + } + reports = append(reports, &report) + } + if len(reports) > 0 { + return reports, nil + } + + images, err = ir.Libpod.ImageRuntime().GetImages() + if err != nil { + return nil, err + } + for _, i := range images { + mounted, path, err := i.Mounted() + if err != nil { + if errors.Cause(err) == storage.ErrLayerUnknown { + continue + } + return nil, err + } + if mounted { + tags, err := i.RepoTags() + if err != nil { + return nil, err + } + reports = append(reports, &entities.ImageMountReport{ + Id: i.ID(), + Name: string(i.Digest()), + Repositories: tags, + Path: path, + }) + } + } + return reports, nil +} + +func (ir *ImageEngine) Unmount(ctx context.Context, nameOrIDs []string, options entities.ImageUnmountOptions) ([]*entities.ImageUnmountReport, error) { + var images []*image.Image + + if options.All { + allImages, err := ir.Libpod.ImageRuntime().GetImages() + if err != nil { + return nil, err + } + for _, img := range allImages { + if !img.IsReadOnly() { + images = append(images, img) + } + } + } else { + for _, i := range nameOrIDs { + img, err := ir.Libpod.ImageRuntime().NewFromLocal(i) + if err != nil { + return nil, err + } + images = append(images, img) + } + } + + reports := []*entities.ImageUnmountReport{} + for _, img := range images { + report := entities.ImageUnmountReport{Id: img.ID()} + if err := img.Unmount(options.Force); err != nil { + if options.All && errors.Cause(err) == storage.ErrLayerNotMounted { + logrus.Debugf("Error umounting image %s, storage.ErrLayerNotMounted", img.ID()) + continue + } + report.Err = errors.Wrapf(err, "error unmounting image %s", img.ID()) + } + reports = append(reports, &report) + } + return reports, nil +} + func ToDomainHistoryLayer(layer *libpodImage.History) entities.ImageHistoryLayer { l := entities.ImageHistoryLayer{} l.ID = layer.ID @@ -225,7 +343,7 @@ func (ir *ImageEngine) Push(ctx context.Context, source string, destination stri case "v2s2", "docker": manifestType = manifest.DockerV2Schema2MediaType default: - return fmt.Errorf("unknown format %q. Choose on of the supported formats: 'oci', 'v2s1', or 'v2s2'", options.Format) + return errors.Errorf("unknown format %q. Choose on of the supported formats: 'oci', 'v2s1', or 'v2s2'", options.Format) } var registryCreds *types.DockerAuthConfig @@ -292,7 +410,7 @@ func (ir *ImageEngine) Push(ctx context.Context, source string, destination stri // // // TODO: Determine Size // report := entities.ImagePruneReport{} -// copy(report.Report.Id, id) +// copy(report.Report.ID, id) // return &report, nil // } @@ -402,7 +520,7 @@ func (ir *ImageEngine) Search(ctx context.Context, term string, opts entities.Im for i := range searchResults { reports[i].Index = searchResults[i].Index reports[i].Name = searchResults[i].Name - reports[i].Description = searchResults[i].Index + reports[i].Description = searchResults[i].Description reports[i].Stars = searchResults[i].Stars reports[i].Official = searchResults[i].Official reports[i].Automated = searchResults[i].Automated diff --git a/pkg/domain/infra/abi/images_list.go b/pkg/domain/infra/abi/images_list.go index dda572ca8..11e2ddb39 100644 --- a/pkg/domain/infra/abi/images_list.go +++ b/pkg/domain/infra/abi/images_list.go @@ -3,8 +3,8 @@ package abi import ( "context" - libpodImage "github.com/containers/libpod/v2/libpod/image" - "github.com/containers/libpod/v2/pkg/domain/entities" + libpodImage "github.com/containers/podman/v2/libpod/image" + "github.com/containers/podman/v2/pkg/domain/entities" ) func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions) ([]*entities.ImageSummary, error) { diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go index c2905b316..6f3c6b902 100644 --- a/pkg/domain/infra/abi/manifest.go +++ b/pkg/domain/infra/abi/manifest.go @@ -17,9 +17,9 @@ import ( "github.com/containers/image/v5/manifest" "github.com/containers/image/v5/transports/alltransports" "github.com/containers/image/v5/types" - libpodImage "github.com/containers/libpod/v2/libpod/image" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/util" + libpodImage "github.com/containers/podman/v2/libpod/image" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/util" "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" diff --git a/pkg/domain/infra/abi/network.go b/pkg/domain/infra/abi/network.go index 26383129c..0183a90d8 100644 --- a/pkg/domain/infra/abi/network.go +++ b/pkg/domain/infra/abi/network.go @@ -10,10 +10,10 @@ import ( "github.com/containernetworking/cni/libcni" cniversion "github.com/containernetworking/cni/pkg/version" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/network" - "github.com/containers/libpod/v2/pkg/util" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/network" + "github.com/containers/podman/v2/pkg/util" "github.com/pkg/errors" ) diff --git a/pkg/domain/infra/abi/parse/parse.go b/pkg/domain/infra/abi/parse/parse.go index fc10e138c..37568ea11 100644 --- a/pkg/domain/infra/abi/parse/parse.go +++ b/pkg/domain/infra/abi/parse/parse.go @@ -4,8 +4,8 @@ import ( "strconv" "strings" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/libpod/define" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index f82da2c95..4ebc37cda 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -11,15 +11,15 @@ import ( "github.com/containers/buildah/pkg/parse" "github.com/containers/image/v5/types" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/libpod/image" - ann "github.com/containers/libpod/v2/pkg/annotations" - "github.com/containers/libpod/v2/pkg/domain/entities" - envLib "github.com/containers/libpod/v2/pkg/env" - ns "github.com/containers/libpod/v2/pkg/namespaces" - createconfig "github.com/containers/libpod/v2/pkg/spec" - "github.com/containers/libpod/v2/pkg/specgen/generate" - "github.com/containers/libpod/v2/pkg/util" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/image" + ann "github.com/containers/podman/v2/pkg/annotations" + "github.com/containers/podman/v2/pkg/domain/entities" + envLib "github.com/containers/podman/v2/pkg/env" + ns "github.com/containers/podman/v2/pkg/namespaces" + createconfig "github.com/containers/podman/v2/pkg/spec" + "github.com/containers/podman/v2/pkg/specgen/generate" + "github.com/containers/podman/v2/pkg/util" "github.com/containers/storage" "github.com/cri-o/ocicni/pkg/ocicni" "github.com/docker/distribution/reference" @@ -340,9 +340,7 @@ func getPodPorts(containers []v1.Container) []ocicni.PortMapping { HostPort: p.HostPort, ContainerPort: p.ContainerPort, Protocol: strings.ToLower(string(p.Protocol)), - } - if p.HostIP != "" { - logrus.Debug("HostIP on port bindings is not supported") + HostIP: p.HostIP, } // only hostPort is utilized in podman context, all container ports // are accessible inside the shared network namespace @@ -453,11 +451,16 @@ func kubeContainerToCreateConfig(ctx context.Context, containerYAML v1.Container containerConfig.Command = []string{} if imageData != nil && imageData.Config != nil { - containerConfig.Command = append(containerConfig.Command, imageData.Config.Entrypoint...) + containerConfig.Command = imageData.Config.Entrypoint } if len(containerYAML.Command) != 0 { - containerConfig.Command = append(containerConfig.Command, containerYAML.Command...) - } else if imageData != nil && imageData.Config != nil { + containerConfig.Command = containerYAML.Command + } + // doc https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes + if len(containerYAML.Args) != 0 { + containerConfig.Command = append(containerConfig.Command, containerYAML.Args...) + } else if len(containerYAML.Command) == 0 { + // Add the Cmd from the image config only if containerYAML.Command and containerYAML.Args are empty containerConfig.Command = append(containerConfig.Command, imageData.Config.Cmd...) } if imageData != nil && len(containerConfig.Command) == 0 { diff --git a/pkg/domain/infra/abi/pods.go b/pkg/domain/infra/abi/pods.go index d1f465362..747da9fd4 100644 --- a/pkg/domain/infra/abi/pods.go +++ b/pkg/domain/infra/abi/pods.go @@ -3,13 +3,13 @@ package abi import ( "context" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/libpod/define" - lpfilters "github.com/containers/libpod/v2/libpod/filters" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/signal" - "github.com/containers/libpod/v2/pkg/specgen" - "github.com/containers/libpod/v2/pkg/specgen/generate" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" + lpfilters "github.com/containers/podman/v2/libpod/filters" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/signal" + "github.com/containers/podman/v2/pkg/specgen" + "github.com/containers/podman/v2/pkg/specgen/generate" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/pkg/domain/infra/abi/pods_stats.go b/pkg/domain/infra/abi/pods_stats.go index 4cab6bea6..16c10710a 100644 --- a/pkg/domain/infra/abi/pods_stats.go +++ b/pkg/domain/infra/abi/pods_stats.go @@ -4,11 +4,11 @@ import ( "context" "fmt" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/pkg/cgroups" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/rootless" - "github.com/containers/libpod/v2/utils" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/pkg/cgroups" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/rootless" + "github.com/containers/podman/v2/utils" "github.com/docker/go-units" "github.com/pkg/errors" ) diff --git a/pkg/domain/infra/abi/runtime.go b/pkg/domain/infra/abi/runtime.go index 9fc089b41..3eab16479 100644 --- a/pkg/domain/infra/abi/runtime.go +++ b/pkg/domain/infra/abi/runtime.go @@ -3,7 +3,7 @@ package abi import ( "sync" - "github.com/containers/libpod/v2/libpod" + "github.com/containers/podman/v2/libpod" ) // Image-related runtime linked against libpod library diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index e4ae6156c..71fe478fd 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -8,15 +8,14 @@ import ( "os/exec" "path/filepath" "strconv" - "syscall" "github.com/containers/common/pkg/config" - "github.com/containers/libpod/v2/libpod/define" - "github.com/containers/libpod/v2/pkg/cgroups" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/rootless" - "github.com/containers/libpod/v2/pkg/util" - "github.com/containers/libpod/v2/utils" + "github.com/containers/podman/v2/libpod/define" + "github.com/containers/podman/v2/pkg/cgroups" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/rootless" + "github.com/containers/podman/v2/pkg/util" + "github.com/containers/podman/v2/utils" "github.com/docker/distribution/reference" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -146,27 +145,6 @@ func movePauseProcessToScope() error { return utils.RunUnderSystemdScope(int(pid), "user.slice", "podman-pause.scope") } -func setRLimits() error { // nolint:deadcode,unused - rlimits := new(syscall.Rlimit) - rlimits.Cur = 1048576 - rlimits.Max = 1048576 - if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil { - if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil { - return errors.Wrapf(err, "error getting rlimits") - } - rlimits.Cur = rlimits.Max - if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, rlimits); err != nil { - return errors.Wrapf(err, "error setting new rlimits") - } - } - return nil -} - -func setUMask() { // nolint:deadcode,unused - // Be sure we can create directories with 0755 mode. - syscall.Umask(0022) -} - // checkInput can be used to verify any of the globalopt values func checkInput() error { // nolint:deadcode,unused return nil @@ -252,13 +230,18 @@ func (ic *ContainerEngine) SystemDf(ctx context.Context, options entities.System } } - named, err := reference.ParseNormalizedNamed(name) - if err != nil { - return nil, err - } - repository = named.Name() - if tagged, isTagged := named.(reference.NamedTagged); isTagged { - tag = tagged.Tag() + if len(name) > 0 { + named, err := reference.ParseNormalizedNamed(name) + if err != nil { + return nil, err + } + repository = named.Name() + if tagged, isTagged := named.(reference.NamedTagged); isTagged { + tag = tagged.Tag() + } + } else { + repository = "<none>" + tag = "<none>" } report := entities.SystemDfImageReport{ diff --git a/pkg/domain/infra/abi/system_novalink.go b/pkg/domain/infra/abi/system_novalink.go index 34c1c0463..3518e9db6 100644 --- a/pkg/domain/infra/abi/system_novalink.go +++ b/pkg/domain/infra/abi/system_novalink.go @@ -5,7 +5,7 @@ package abi import ( "context" - "github.com/containers/libpod/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/entities" "github.com/pkg/errors" ) diff --git a/pkg/domain/infra/abi/system_varlink.go b/pkg/domain/infra/abi/system_varlink.go index 25722986d..d0a5c5407 100644 --- a/pkg/domain/infra/abi/system_varlink.go +++ b/pkg/domain/infra/abi/system_varlink.go @@ -5,10 +5,10 @@ package abi import ( "context" - "github.com/containers/libpod/v2/pkg/domain/entities" - iopodman "github.com/containers/libpod/v2/pkg/varlink" - iopodmanAPI "github.com/containers/libpod/v2/pkg/varlinkapi" - "github.com/containers/libpod/v2/version" + "github.com/containers/podman/v2/pkg/domain/entities" + iopodman "github.com/containers/podman/v2/pkg/varlink" + iopodmanAPI "github.com/containers/podman/v2/pkg/varlinkapi" + "github.com/containers/podman/v2/version" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/varlink/go/varlink" @@ -23,7 +23,7 @@ func (ic *ContainerEngine) VarlinkService(_ context.Context, opts entities.Servi "Atomic", "podman", version.Version, - "https://github.com/containers/libpod", + "https://github.com/containers/podman", ) if err != nil { return errors.Wrapf(err, "unable to create new varlink service") diff --git a/pkg/domain/infra/abi/terminal/sigproxy_linux.go b/pkg/domain/infra/abi/terminal/sigproxy_linux.go index 973efbc0e..f484e926c 100644 --- a/pkg/domain/infra/abi/terminal/sigproxy_linux.go +++ b/pkg/domain/infra/abi/terminal/sigproxy_linux.go @@ -4,8 +4,8 @@ import ( "os" "syscall" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/pkg/signal" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/pkg/signal" "github.com/sirupsen/logrus" ) @@ -22,7 +22,7 @@ func ProxySignals(ctr *libpod.Container) { // intended for the podman command itself. // SIGURG was added because of golang 1.14 and its preemptive changes // causing more signals to "show up". - // https://github.com/containers/libpod/issues/5483 + // https://github.com/containers/podman/issues/5483 if s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG { continue } diff --git a/pkg/domain/infra/abi/terminal/terminal.go b/pkg/domain/infra/abi/terminal/terminal.go index bd78729e7..0b6e57f49 100644 --- a/pkg/domain/infra/abi/terminal/terminal.go +++ b/pkg/domain/infra/abi/terminal/terminal.go @@ -5,7 +5,7 @@ import ( "os" "os/signal" - lsignal "github.com/containers/libpod/v2/pkg/signal" + lsignal "github.com/containers/podman/v2/pkg/signal" "github.com/docker/docker/pkg/term" "github.com/pkg/errors" "github.com/sirupsen/logrus" diff --git a/pkg/domain/infra/abi/terminal/terminal_linux.go b/pkg/domain/infra/abi/terminal/terminal_linux.go index 5575c6d11..8886625a6 100644 --- a/pkg/domain/infra/abi/terminal/terminal_linux.go +++ b/pkg/domain/infra/abi/terminal/terminal_linux.go @@ -6,8 +6,8 @@ import ( "fmt" "os" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/libpod/define" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/libpod/define" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh/terminal" diff --git a/pkg/domain/infra/abi/trust.go b/pkg/domain/infra/abi/trust.go index 44165c6f7..c697722ee 100644 --- a/pkg/domain/infra/abi/trust.go +++ b/pkg/domain/infra/abi/trust.go @@ -7,8 +7,8 @@ import ( "os" "strings" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/trust" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/trust" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) diff --git a/pkg/domain/infra/abi/volumes.go b/pkg/domain/infra/abi/volumes.go index 8db89899e..340f00953 100644 --- a/pkg/domain/infra/abi/volumes.go +++ b/pkg/domain/infra/abi/volumes.go @@ -3,10 +3,10 @@ package abi import ( "context" - "github.com/containers/libpod/v2/libpod" - "github.com/containers/libpod/v2/pkg/domain/entities" - "github.com/containers/libpod/v2/pkg/domain/filters" - "github.com/containers/libpod/v2/pkg/domain/infra/abi/parse" + "github.com/containers/podman/v2/libpod" + "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v2/pkg/domain/filters" + "github.com/containers/podman/v2/pkg/domain/infra/abi/parse" "github.com/pkg/errors" ) |