vendor: bump c/common

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2024-07-31 21:55:28 +02:00
parent 737c08224e
commit 75a316aae4
6 changed files with 21 additions and 14 deletions

View File

@ -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
}

View File

@ -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

View File

@ -1,4 +1,4 @@
package version
// Version is the version of the build.
const Version = "0.60.0"
const Version = "0.61.0-dev"