diff --git a/go.mod b/go.mod index fd12d40903..27e3718d5d 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/checkpoint-restore/go-criu/v7 v7.1.0 github.com/containernetworking/plugins v1.5.1 github.com/containers/buildah v1.37.0 - github.com/containers/common v0.60.0 + github.com/containers/common v0.60.1-0.20240731140509-ae4a61e1b2e0 github.com/containers/conmon v2.0.20+incompatible github.com/containers/gvisor-tap-vsock v0.7.4 github.com/containers/image/v5 v5.32.0 diff --git a/go.sum b/go.sum index 8cb6b4717e..762a105af0 100644 --- a/go.sum +++ b/go.sum @@ -79,8 +79,8 @@ github.com/containernetworking/plugins v1.5.1 h1:T5ji+LPYjjgW0QM+KyrigZbLsZ8jaX+ github.com/containernetworking/plugins v1.5.1/go.mod h1:MIQfgMayGuHYs0XdNudf31cLLAC+i242hNm6KuDGqCM= github.com/containers/buildah v1.37.0 h1:jvHwu1vIwIqnHyOSg9eef9Apdpry+5oWLrm43gdf8Rk= github.com/containers/buildah v1.37.0/go.mod h1:MKd79tkluMf6vtH06SedhBQK5OB7E0pFVIuiTTw3dJk= -github.com/containers/common v0.60.0 h1:QMNygqiiit9LU/yqee9Dv0N0oQ+rQq41ElfdOBQtw7w= -github.com/containers/common v0.60.0/go.mod h1:dtKVe11xkV89tqzRX9s/B0ORjeB2dy5UB46aGjunMn8= +github.com/containers/common v0.60.1-0.20240731140509-ae4a61e1b2e0 h1:WqC1NUmYpiEIqYoy+44TFvYEUYO5oBlDOdFZ2I0S1Vo= +github.com/containers/common v0.60.1-0.20240731140509-ae4a61e1b2e0/go.mod h1:k0URVvOTicn3w0y4qc31Ughcb9n28atRHfjd0NpkCiA= github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg= github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I= github.com/containers/gvisor-tap-vsock v0.7.4 h1:iOtr/KEi+r599OOx1+9Qbss91jD5yxh1HO35MKTdths= diff --git a/vendor/github.com/containers/common/libimage/manifest_list.go b/vendor/github.com/containers/common/libimage/manifest_list.go index 5093ea3e58..1a6004c01a 100644 --- a/vendor/github.com/containers/common/libimage/manifest_list.go +++ b/vendor/github.com/containers/common/libimage/manifest_list.go @@ -309,14 +309,14 @@ type ManifestListAddOptions struct { Password string } -func (m *ManifestList) parseNameToExtantReference(ctx context.Context, name string, manifestList bool, what string) (types.ImageReference, error) { +func (m *ManifestList) parseNameToExtantReference(ctx context.Context, sys *types.SystemContext, name string, manifestList bool, what string) (types.ImageReference, error) { ref, err := alltransports.ParseImageName(name) if err != nil { withDocker := fmt.Sprintf("%s://%s", docker.Transport.Name(), name) ref, err = alltransports.ParseImageName(withDocker) if err == nil { var src types.ImageSource - src, err = ref.NewImageSource(ctx, nil) + src, err = ref.NewImageSource(ctx, sys) if err == nil { src.Close() } @@ -339,11 +339,6 @@ func (m *ManifestList) Add(ctx context.Context, name string, options *ManifestLi options = &ManifestListAddOptions{} } - ref, err := m.parseNameToExtantReference(ctx, name, false, "image to add to manifest list") - if err != nil { - return "", err - } - // Now massage in the copy-related options into the system context. systemContext := m.image.runtime.systemContextCopy() if options.AuthFilePath != "" { @@ -363,6 +358,12 @@ func (m *ManifestList) Add(ctx context.Context, name string, options *ManifestLi Password: options.Password, } } + + ref, err := m.parseNameToExtantReference(ctx, systemContext, name, false, "image to add to manifest list") + if err != nil { + return "", err + } + locker, err := manifests.LockerForImage(m.image.runtime.store, m.ID()) if err != nil { return "", err @@ -442,7 +443,7 @@ func (m *ManifestList) AddArtifact(ctx context.Context, options *ManifestListAdd opts.LayerMediaType = &options.LayerType } if options.Subject != "" { - ref, err := m.parseNameToExtantReference(ctx, options.Subject, true, "subject for artifact manifest") + ref, err := m.parseNameToExtantReference(ctx, nil, options.Subject, true, "subject for artifact manifest") if err != nil { return "", err } @@ -547,7 +548,7 @@ func (m *ManifestList) AnnotateInstance(d digest.Digest, options *ManifestListAn } } if options.Subject != "" { - ref, err := m.parseNameToExtantReference(ctx, options.Subject, true, "subject for image index") + ref, err := m.parseNameToExtantReference(ctx, nil, options.Subject, true, "subject for image index") if err != nil { return err } diff --git a/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go b/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go index cde2d596bd..ead630e755 100644 --- a/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go +++ b/vendor/github.com/containers/common/pkg/cgroups/systemd_linux.go @@ -130,6 +130,12 @@ func systemdDestroyConn(path string, c *systemdDbus.Conn) error { ch := make(chan string) _, err := c.StopUnitContext(context.TODO(), name, "replace", ch) if err != nil { + if dbe, ok := err.(dbus.Error); ok { + if dbe.Name == "org.freedesktop.systemd1.NoSuchUnit" { + // the unit was already removed + return nil + } + } return err } <-ch diff --git a/vendor/github.com/containers/common/version/version.go b/vendor/github.com/containers/common/version/version.go index aec8361bf9..c73ec15cd4 100644 --- a/vendor/github.com/containers/common/version/version.go +++ b/vendor/github.com/containers/common/version/version.go @@ -1,4 +1,4 @@ package version // Version is the version of the build. -const Version = "0.60.0" +const Version = "0.61.0-dev" diff --git a/vendor/modules.txt b/vendor/modules.txt index 442391c64e..dbe5563860 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -170,7 +170,7 @@ github.com/containers/buildah/pkg/sshagent github.com/containers/buildah/pkg/util github.com/containers/buildah/pkg/volumes github.com/containers/buildah/util -# github.com/containers/common v0.60.0 +# github.com/containers/common v0.60.1-0.20240731140509-ae4a61e1b2e0 ## explicit; go 1.21.0 github.com/containers/common/internal github.com/containers/common/internal/attributedstring