Skip to content

Commit

Permalink
build(deps): bump all dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>
  • Loading branch information
jkroepke committed Jul 18, 2024
1 parent 714d8c4 commit 279f98d
Show file tree
Hide file tree
Showing 17 changed files with 370 additions and 351 deletions.
65 changes: 38 additions & 27 deletions THIRD-PARTY-LICENSES.md

Large diffs are not rendered by default.

427 changes: 214 additions & 213 deletions go.mod

Large diffs are not rendered by default.

161 changes: 83 additions & 78 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/storage/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"time"

"github.com/docker/distribution/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver"
godigest "github.com/opencontainers/go-digest"
"github.com/opencontainers/image-spec/schema"
imeta "github.com/opencontainers/image-spec/specs-go"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/gc/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/docker/distribution/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"

Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/gc/gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"
"time"

"github.com/docker/distribution/registry/storage/driver/factory"
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
"github.com/distribution/distribution/v3/registry/storage/driver/factory"
_ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws"
guuid "github.com/gofrs/uuid"
. "github.com/smartystreets/goconvey/convey"
"gopkg.in/resty.v1"
Expand Down
10 changes: 5 additions & 5 deletions pkg/storage/imagestore/imagestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"time"
"unicode/utf8"

"github.com/docker/distribution/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver"
guuid "github.com/gofrs/uuid"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down Expand Up @@ -376,7 +376,7 @@ func (is *ImageStore) GetNextRepository(repo string) (string, error) {
}

if errors.Is(err, io.EOF) ||
(errors.As(err, driverErr) && errors.Is(driverErr.Enclosed, io.EOF)) {
(errors.As(err, driverErr) && errors.Is(driverErr.Detail, io.EOF)) {
return store, nil
}

Expand Down Expand Up @@ -845,7 +845,7 @@ func (is *ImageStore) FinishBlobUpload(repo, uuid string, body io.Reader, dstDig
return zerr.ErrUploadNotFound
}

if err := fileWriter.Commit(); err != nil {
if err := fileWriter.Commit(context.Background()); err != nil {
is.log.Error().Err(err).Msg("failed to commit file")

return err
Expand Down Expand Up @@ -942,7 +942,7 @@ func (is *ImageStore) FullBlobUpload(repo string, body io.Reader, dstDigest godi
return "", -1, err
}

if err := blobFile.Commit(); err != nil {
if err := blobFile.Commit(context.Background()); err != nil {
is.log.Error().Err(err).Str("blob", src).Msg("failed to commit blob")

return "", -1, err
Expand Down Expand Up @@ -1100,7 +1100,7 @@ func (is *ImageStore) DeleteBlobUpload(repo, uuid string) error {

defer writer.Close()

if err := writer.Cancel(); err != nil {
if err := writer.Cancel(context.Background()); err != nil {
is.log.Error().Err(err).Str("blobUploadPath", blobUploadPath).Msg("failed to delete blob upload")

return err
Expand Down
11 changes: 6 additions & 5 deletions pkg/storage/local/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package local
import (
"bufio"
"bytes"
"context"
"errors"
"io"
"os"
Expand All @@ -11,7 +12,7 @@ import (
"time"
"unicode/utf8"

storagedriver "github.com/docker/distribution/registry/storage/driver"
storagedriver "github.com/distribution/distribution/v3/registry/storage/driver"

zerr "zotregistry.dev/zot/errors"
storageConstants "zotregistry.dev/zot/pkg/storage/constants"
Expand Down Expand Up @@ -176,7 +177,7 @@ func (driver *Driver) WriteFile(filepath string, content []byte) (int, error) {

nbytes, err := io.Copy(writer, bytes.NewReader(content))
if err != nil {
_ = writer.Cancel()
_ = writer.Cancel(context.Background())

return -1, driver.formatErr(err)
}
Expand Down Expand Up @@ -315,7 +316,7 @@ func (driver *Driver) formatErr(err error) error {
default:
storageError := storagedriver.Error{
DriverName: driver.Name(),
Enclosed: err,
Detail: err,
}

return storageError
Expand Down Expand Up @@ -420,7 +421,7 @@ func (fw *fileWriter) Close() error {
return nil
}

func (fw *fileWriter) Cancel() error {
func (fw *fileWriter) Cancel(_ context.Context) error {
if fw.closed {
return zerr.ErrFileAlreadyClosed
}
Expand All @@ -431,7 +432,7 @@ func (fw *fileWriter) Cancel() error {
return os.Remove(fw.file.Name())
}

func (fw *fileWriter) Commit() error {
func (fw *fileWriter) Commit(_ context.Context) error {
//nolint: gocritic
if fw.closed {
return zerr.ErrFileAlreadyClosed
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/local/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"testing"

storagedriver "github.com/docker/distribution/registry/storage/driver"
storagedriver "github.com/distribution/distribution/v3/registry/storage/driver"
. "github.com/smartystreets/goconvey/convey"

storageConstants "zotregistry.dev/zot/pkg/storage/constants"
Expand Down
6 changes: 3 additions & 3 deletions pkg/storage/s3/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"io"

// Add s3 support.
"github.com/docker/distribution/registry/storage/driver"
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
"github.com/distribution/distribution/v3/registry/storage/driver"
_ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws"

storageConstants "zotregistry.dev/zot/pkg/storage/constants"
)
Expand Down Expand Up @@ -65,7 +65,7 @@ func (driver *Driver) WriteFile(filepath string, content []byte) (int, error) {
return -1, err
}

if err := stwr.Commit(); err != nil {
if err := stwr.Commit(context.Background()); err != nil {
return -1, err
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package s3

import (
// Add s3 support.
"github.com/docker/distribution/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver"
// Load s3 driver.
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
_ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws"

"zotregistry.dev/zot/pkg/extensions/monitoring"
zlog "zotregistry.dev/zot/pkg/log"
Expand Down
6 changes: 3 additions & 3 deletions pkg/storage/s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"testing"
"time"

"github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/factory"
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
"github.com/distribution/distribution/v3/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver/factory"
_ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws"
guuid "github.com/gofrs/uuid"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/scrub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"testing"

"github.com/docker/distribution/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver"
guuid "github.com/gofrs/uuid"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
7 changes: 4 additions & 3 deletions pkg/storage/storage.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package storage

import (
"context"
"encoding/json"
"fmt"
"strings"

"github.com/docker/distribution/registry/storage/driver/factory"
"github.com/distribution/distribution/v3/registry/storage/driver/factory"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"

Expand Down Expand Up @@ -68,7 +69,7 @@ func New(config *config.Config, linter common.Lint, metrics monitoring.MetricSer
return storeController, fmt.Errorf("storageDriver '%s' unsupported storage driver: %w", storeName, zerr.ErrBadConfig)
}
// Init a Storager from connection string.
store, err := factory.Create(storeName, config.Storage.StorageDriver)
store, err := factory.Create(context.Background(), storeName, config.Storage.StorageDriver)
if err != nil {
log.Error().Err(err).Str("rootDir", config.Storage.RootDirectory).Msg("failed to create s3 service")

Expand Down Expand Up @@ -183,7 +184,7 @@ func getSubStore(cfg *config.Config, subPaths map[string]config.StorageConfig,
}

// Init a Storager from connection string.
store, err := factory.Create(storeName, storageConfig.StorageDriver)
store, err := factory.Create(context.Background(), storeName, storageConfig.StorageDriver)
if err != nil {
log.Error().Err(err).Str("rootDir", storageConfig.RootDirectory).Msg("failed to create s3 service")

Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"time"

// Add s3 support.
"github.com/docker/distribution/registry/storage/driver"
"github.com/docker/distribution/registry/storage/driver/factory"
_ "github.com/docker/distribution/registry/storage/driver/s3-aws"
"github.com/distribution/distribution/v3/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver/factory"
_ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws"
guuid "github.com/gofrs/uuid"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down Expand Up @@ -81,7 +81,7 @@ func createObjectsStore(rootDir string, cacheDir string) (

storeName := fmt.Sprintf("%v", storageDriverParams["name"])

store, err := factory.Create(storeName, storageDriverParams)
store, err := factory.Create(context.Background(), storeName, storageDriverParams)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"
"time"

storagedriver "github.com/docker/distribution/registry/storage/driver"
storagedriver "github.com/distribution/distribution/v3/registry/storage/driver"
godigest "github.com/opencontainers/go-digest"
ispec "github.com/opencontainers/image-spec/specs-go/v1"

Expand Down
2 changes: 1 addition & 1 deletion pkg/test/mocks/storage_driver_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

"github.com/docker/distribution/registry/storage/driver"
"github.com/distribution/distribution/v3/registry/storage/driver"
)

type StorageDriverMock struct {
Expand Down

0 comments on commit 279f98d

Please sign in to comment.