Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Bump dependencies #787

Merged
merged 3 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/oci-dist-spec-content-discovery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
cd ../
git clone https://github.com/opencontainers/distribution-spec.git
pushd distribution-spec/conformance
git checkout v1.1.0-rc.3
git checkout v1.1.0
go test -c
./conformance.test
popd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oci-dist-spec-content-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: |
git clone https://github.com/opencontainers/distribution-spec.git
pushd distribution-spec/conformance
git checkout v1.1.0-rc.3
git checkout v1.1.0
go test -c
./conformance.test
popd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oci-dist-spec-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: |
git clone https://github.com/opencontainers/distribution-spec.git
pushd distribution-spec/conformance
git checkout v1.1.0-rc.3
git checkout v1.1.0
go test -c
./conformance.test
popd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oci-dist-spec-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
cd ../
git clone https://github.com/opencontainers/distribution-spec.git
pushd distribution-spec/conformance
git checkout v1.1.0-rc.3
git checkout v1.1.0
go test -c
./conformance.test
popd
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ config.yml.bak
*.test
telemetry/*.yml
/.mock-fs
/.local
9 changes: 3 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
run:
timeout: 2m

skip-dirs:
- .go-skynet

linters-settings:
cyclop:
max-complexity: 16
gosec:
excludes:
- G114
lll:
line-length: 120
tab-width: 1

lll:
line-length: 120
tab-width: 1

linters:
enable:
Expand Down
28 changes: 6 additions & 22 deletions common/v1/id.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ const (
StoreKindPostgres StoreKind = "postgres"
StoreKindSQLite StoreKind = "sqlite"

MaxS3UploadParts int32 = 1000

MockStorageBackendMemMapped MockStorageBackend = iota + 1
MockStorageBackendFileBased
)
Expand Down
5 changes: 5 additions & 0 deletions dfs/filebase/filebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package filebase
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"time"
Expand Down Expand Up @@ -69,6 +70,10 @@ func (fb *filebase) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

ctx, cancel := context.WithTimeout(ctx, time.Minute*10)
defer cancel()

Expand Down
5 changes: 5 additions & 0 deletions dfs/ipfs/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package p2p
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -117,6 +118,10 @@ func (ipfs *ipfsP2p) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

session, ok := ipfs.uploadSession.Get(uploadId)
if !ok {
return s3types.CompletedPart{}, fmt.Errorf("UploadPart: multipart session not found")
Expand Down
5 changes: 5 additions & 0 deletions dfs/mock/memMappedSystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mock

import (
"context"
"errors"
"fmt"
"io"
"net"
Expand Down Expand Up @@ -75,6 +76,10 @@ func (ms *memMappedMockStorage) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

if err := ms.validateLayerPrefix(layerKey); err != nil {
return s3types.CompletedPart{}, err
}
Expand Down
5 changes: 5 additions & 0 deletions dfs/mock/mockFileSystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mock

import (
"context"
"errors"
"fmt"
"io"
"net"
Expand Down Expand Up @@ -78,6 +79,10 @@ func (ms *fileBasedMockStorage) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

if err := ms.validateLayerPrefix(layerKey); err != nil {
return s3types.CompletedPart{}, err
}
Expand Down
5 changes: 5 additions & 0 deletions dfs/storj/storj.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package storj
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"time"
Expand Down Expand Up @@ -67,6 +68,10 @@ func (sj *storj) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

ctx, cancel := context.WithTimeout(ctx, time.Minute*10)
defer cancel()

Expand Down
6 changes: 6 additions & 0 deletions dfs/storj/uplink/uplink.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package uplink

import (
"context"
"errors"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -75,9 +76,14 @@ func (u *storjUplink) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

ctx, cancel := context.WithTimeout(ctx, time.Minute*20)
defer cancel()

//nolint:gosec
resp, err := u.client.UploadPart(ctx, u.bucket, key, uploadId, uint32(partNumber))
if err != nil {
return s3types.CompletedPart{}, err
Expand Down
Loading
Loading