From 743065153621e4b64fe50c4a19bf67fe1ee88a9d Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Tue, 31 Oct 2023 14:53:02 -0700 Subject: [PATCH] cleanup: make blob sizes easier to understand This is a followup to https://github.com/distribution/distribution/pull/4139 Signed-off-by: Milos Gajdos --- registry/handlers/manifests.go | 2 +- registry/proxy/proxyblobstore_test.go | 2 +- registry/storage/filereader.go | 2 +- registry/storage/io.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/registry/handlers/manifests.go b/registry/handlers/manifests.go index d7bbab92..f571afd9 100644 --- a/registry/handlers/manifests.go +++ b/registry/handlers/manifests.go @@ -24,7 +24,7 @@ import ( const ( defaultArch = "amd64" defaultOS = "linux" - maxManifestBodySize = 4 << 20 + maxManifestBodySize = 4 * 1024 * 1024 imageClass = "image" ) diff --git a/registry/proxy/proxyblobstore_test.go b/registry/proxy/proxyblobstore_test.go index 6a4324e7..45bc5742 100644 --- a/registry/proxy/proxyblobstore_test.go +++ b/registry/proxy/proxyblobstore_test.go @@ -320,7 +320,7 @@ func TestProxyStoreServeMany(t *testing.T) { func TestProxyStoreServeBig(t *testing.T) { te := makeTestEnv(t, "foo/bar") - blobSize := 2 << 20 + blobSize := 2 * 1024 * 1024 blobCount := 4 numUnique := 2 populate(t, te, blobCount, blobSize, numUnique) diff --git a/registry/storage/filereader.go b/registry/storage/filereader.go index b5004eb4..4a0ea436 100644 --- a/registry/storage/filereader.go +++ b/registry/storage/filereader.go @@ -15,7 +15,7 @@ import ( // set this correctly, so we may want to leave it to the driver. For // out of process drivers, we'll have to optimize this buffer size for // local communication. -const fileReaderBufferSize = 4 << 20 +const fileReaderBufferSize = 4 * 1024 * 1024 // remoteFileReader provides a read seeker interface to files stored in // storagedriver. Used to implement part of layer interface and will be used diff --git a/registry/storage/io.go b/registry/storage/io.go index a96296e5..c4c129fd 100644 --- a/registry/storage/io.go +++ b/registry/storage/io.go @@ -9,7 +9,7 @@ import ( ) const ( - maxBlobGetSize = 4 << 20 + maxBlobGetSize = 4 * 1024 * 1024 ) func getContent(ctx context.Context, driver driver.StorageDriver, p string) ([]byte, error) {