vendor: update c/{common,image,storage} to latest main

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-06-05 11:39:23 +02:00
parent d44f0afa84
commit 96abeafc61
65 changed files with 2114 additions and 4036 deletions

View File

@@ -4,7 +4,6 @@ import (
cryptorand "crypto/rand"
"database/sql/driver"
"encoding/json"
"errors"
"fmt"
"io"
"sync"
@@ -98,7 +97,7 @@ func NewULID() (ULID, error) {
obj := ulidEntropyPool.Get()
entropy, ok := obj.(io.Reader)
if !ok {
return u, fmt.Errorf("failed to cast %+v to io.Reader", obj)
return u, fmt.Errorf("failed to cast %+v to io.Reader: %w", obj, ErrFormat)
}
id, err := ulid.New(ulid.Now(), entropy)
@@ -181,12 +180,12 @@ func (u *ULID) UnmarshalBSON(data []byte) error {
if ud, ok := m["data"].(string); ok {
id, err := ulid.ParseStrict(ud)
if err != nil {
return fmt.Errorf("couldn't parse bson bytes as ULID: %w", err)
return fmt.Errorf("couldn't parse bson bytes as ULID: %w: %w", err, ErrFormat)
}
u.ULID = id
return nil
}
return errors.New("couldn't unmarshal bson bytes as ULID")
return fmt.Errorf("couldn't unmarshal bson bytes as ULID: %w", ErrFormat)
}
// DeepCopyInto copies the receiver and writes its value into out.