summaryrefslogtreecommitdiff
path: root/app-emulation/docker-registry
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-12-24 14:11:38 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-12-24 14:11:38 +0000
commitde49812990871e1705b64051c35161d5e6400269 (patch)
tree5e1e8fcb0ff4579dbd22a1bfee28a6b97dc8aaeb /app-emulation/docker-registry
parent536c3711867ec947c1738f2c4b96f22e4863322d (diff)
gentoo resync : 24.12.2018
Diffstat (limited to 'app-emulation/docker-registry')
-rw-r--r--app-emulation/docker-registry/Manifest4
-rw-r--r--app-emulation/docker-registry/docker-registry-2.7.0-r1.ebuild47
-rw-r--r--app-emulation/docker-registry/docker-registry-2.7.0.ebuild40
-rw-r--r--app-emulation/docker-registry/files/docker-registry-2.7.0-notification-metrics.patch398
4 files changed, 489 insertions, 0 deletions
diff --git a/app-emulation/docker-registry/Manifest b/app-emulation/docker-registry/Manifest
index 520df8bc4a14..37f8339b553d 100644
--- a/app-emulation/docker-registry/Manifest
+++ b/app-emulation/docker-registry/Manifest
@@ -1,8 +1,12 @@
AUX docker-registry-2.6.1-notifications-expvar.patch 2360 BLAKE2B 15cf7bbc25503c6af51552ec18a8d585a5ae4e2b79ed385da01da568e79e5f68e6fbd4dfbbd5ed8a40ffc86a337b44fd78457658d28f57f76b081a4509c6ff6a SHA512 2a1aa8fd0f5df6380c8b0b11bdbc0c8f62c02cdbd87d1b697f691189c04409c71a69cf50e36704cb8b7c3c6040c88c77110076aae439aa9e173f95b4347dbc0a
+AUX docker-registry-2.7.0-notification-metrics.patch 15565 BLAKE2B 31d3bc9d40c07939aca340d0c9bb516eb5afb9191f5d5d7c92b85f9f6dc8e1d86b659df337565eb09a0d08558ee50e1301734fcfa0449a920fcb332c00452c1a SHA512 a2161e5d2638f5682d70d900aba86cba3ca61ae99f7e325a5691c2cc4e5408f4a543c6204a05c19748494f1145e8468cf27e359ffad624fdac1e710974654e2c
AUX registry.confd 85 BLAKE2B 0997c1ad7ee8fc165a87cfebeea75694487c8d8b62130fb19fd4d9c55cc605754537deaea6e114a9fb28e46eb67bb6ab9d01de0971163acf22f223ca8ec84605 SHA512 7cbd19f545b659e2d295938b320710ae20b3c2222fcb6668216985c6e55bf51647041dec1c33ab7271e464f13001d8095fef9240d3390cff7e65028d3432c4f4
AUX registry.initd 606 BLAKE2B ed8af2651d91be13578edb561c067cfd3e72dfe42a6111be8930d61f233248b7364659a8db5a9800eaa167d76a8b2daf9d121970622de235e61fa0f10ad85174 SHA512 af7780264d068adcd0d6a6768b88ab43c26081b71d1ebd591ca6d175e413cdeee935a6f50d9833775690f0b47daadcc33286f86fb5eb98d2e674b225122aabce
AUX registry.logrotated 89 BLAKE2B c16fab4c6a3c4fd9f48370ae30505408a49e07c2a7ea7fc119717efcd840ad489c92855e27a5546219b3cdeb257642eb65abc2d544859295688925ae2e94ecb3 SHA512 f824b33a1fa38802a8aa79599843b0ea065603799823352e9515c50bfc61c43a03e9eb5327f9c687b8c3864fc633ad1a46bff9e91f4c54a46a09e67d2f6f833b
AUX registry.service 323 BLAKE2B 1be481d08a283793d10ef870fc299e1c284087878e67ec54f44e662c616127bc411fdde19659cf7acd69787054c624c5c5206434c36b4e5a0fcceaf79c2e78f0 SHA512 67d2b69c1fc497774e3171628fa73b9b9521e19c76414e32721994f2ba614bd3c6896c578c9d9b8af0ad4972b9da0c504ef787a7585a550be4bfe1bd40eafc15
DIST docker-registry-2.6.2.tar.gz 1579760 BLAKE2B d0e067f2e9124847b5e362f23ca7d67655fbf0a6227efc3fd9073d5360389d6d8531e5709b52225c54e6e3097a2d5d79102e27fd09412b95d2e5d8a4a30dde2d SHA512 a091db2e15d7c1dc8cd39a40de5bb63cc1ead68e95dfaf6b3735a789adb87f146c03eff81f700e0059e5f6ffc43e6c3dd3358503697882cb080b991629f82c60
+DIST docker-registry-2.7.0.tar.gz 1996485 BLAKE2B 49022546b72a1ea2b457a3dc059d8940bfba3070208b2962f8acd1351312d568d6facc1690ae8ee78742b5647c3a84bd6538a9eb0c279aec0a8dfae2c823fa61 SHA512 72bf5f0953c58e4d1adf6427ee13a9456204ab278d4489277e4dd1b3a3df6717cc02c966cdfcdf77d86e769209fa18e377e0b12a6c02b9f58980185e9844aec6
EBUILD docker-registry-2.6.2-r1.ebuild 1199 BLAKE2B dfe3762a2b4e593b653fd2a8ef2eda0b1988163daff5551280c34f8e078a69c802d615be55ae257bcdc24cc9ac76e32317133cd6bc83d3f536b206332b7bd073 SHA512 1405e36c07065c0d6c75fc59548b64f5bc9e69726324e5e6f552be1790cdcf4057a78f6d770e3e1144c36b2edc1e483c1e455550785e263474942b676ac6f643
+EBUILD docker-registry-2.7.0-r1.ebuild 1253 BLAKE2B 21be455cf1c5f355fff318e3a6ed89f8b0108818d26066b8682c4c829eed60dd6ba90cc2cf59fd89433b3e51101beebf83f8e1313ee587fc7fef38d6d301b521 SHA512 211b918ebfe793e90af0e55e58f8a4a5eca0f51a3ba2b8959681e8d349cc242c405303f8045e346c458eae9b14f8fa2479f868fa2cb1ce54a9717cdece2ef0e6
+EBUILD docker-registry-2.7.0.ebuild 1130 BLAKE2B 04dfb05346a527aeec1be5446d506aa90620a6288f66a7d3c1119a7bfdc500a361a08064bd2104fd58b9462c061f33607e315d666f8579caa4484431f6e08a1b SHA512 d935b18dc1154c9d5712a698f5e12be20d4bb998d87743e5db7a46ff2c4ad7906ed6aae8b90aba404d6351ab24852cb1aee00b4ca1caf91267e8496c9c2bfd84
MISC metadata.xml 310 BLAKE2B b7a4e4e347c4b262857668fb0bba20e1efce6abc449cf3614538b34f03c897ce78e637db513a66e8e5ff9b1262df44d864aa41904ef7e86eee384bdafbb014cb SHA512 bcf043907e7e2ad9ef21a4b02b4aeb0f50bd17b1e5315653b2339036d4775bde661d711d4e84536f657c7bf9247ef446f1c95abdf14699620e44a104c9e1fe0a
diff --git a/app-emulation/docker-registry/docker-registry-2.7.0-r1.ebuild b/app-emulation/docker-registry/docker-registry-2.7.0-r1.ebuild
new file mode 100644
index 000000000000..7f36e363292f
--- /dev/null
+++ b/app-emulation/docker-registry/docker-registry-2.7.0-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit golang-vcs-snapshot systemd user
+
+KEYWORDS="~amd64"
+EGO_PN="github.com/docker/distribution"
+EGIT_COMMIT="v${PV}"
+SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+DESCRIPTION="Docker Registry 2.0"
+HOMEPAGE="https://github.com/docker/distribution"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+SVCNAME=registry
+
+pkg_setup() {
+ enewgroup ${SVCNAME}
+ enewuser ${SVCNAME} -1 -1 /dev/null ${SVCNAME}
+}
+
+src_prepare() {
+ default
+ pushd src/${EGO_PN} || die
+ eapply "${FILESDIR}"/${P}-notification-metrics.patch
+ popd || die
+}
+
+src_compile() {
+ GOPATH="${S}" \
+ go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}/..." || die
+}
+
+src_install() {
+ exeinto /usr/libexec/${PN}
+ doexe bin/*
+ insinto /etc/docker/registry
+ newins src/${EGO_PN}/cmd/registry/config-example.yml config.yml.example
+ newinitd "${FILESDIR}/${SVCNAME}.initd" "${SVCNAME}"
+ newconfd "${FILESDIR}/${SVCNAME}.confd" "${SVCNAME}"
+ systemd_dounit "${FILESDIR}/${SVCNAME}.service"
+ keepdir /var/{lib,log}/${SVCNAME}
+ fowners ${SVCNAME}:${SVCNAME} /var/{lib,log}/${SVCNAME}
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${SVCNAME}.logrotated" "${SVCNAME}"
+}
diff --git a/app-emulation/docker-registry/docker-registry-2.7.0.ebuild b/app-emulation/docker-registry/docker-registry-2.7.0.ebuild
new file mode 100644
index 000000000000..152ac01305b7
--- /dev/null
+++ b/app-emulation/docker-registry/docker-registry-2.7.0.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit golang-vcs-snapshot systemd user
+
+KEYWORDS="~amd64"
+EGO_PN="github.com/docker/distribution"
+EGIT_COMMIT="v${PV}"
+SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+DESCRIPTION="Docker Registry 2.0"
+HOMEPAGE="https://github.com/docker/distribution"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+SVCNAME=registry
+
+pkg_setup() {
+ enewgroup ${SVCNAME}
+ enewuser ${SVCNAME} -1 -1 /dev/null ${SVCNAME}
+}
+
+src_compile() {
+ GOPATH="${S}" \
+ go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}/..." || die
+}
+
+src_install() {
+ exeinto /usr/libexec/${PN}
+ doexe bin/*
+ insinto /etc/docker/registry
+ newins src/${EGO_PN}/cmd/registry/config-example.yml config.yml.example
+ newinitd "${FILESDIR}/${SVCNAME}.initd" "${SVCNAME}"
+ newconfd "${FILESDIR}/${SVCNAME}.confd" "${SVCNAME}"
+ systemd_dounit "${FILESDIR}/${SVCNAME}.service"
+ keepdir /var/{lib,log}/${SVCNAME}
+ fowners ${SVCNAME}:${SVCNAME} /var/{lib,log}/${SVCNAME}
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${SVCNAME}.logrotated" "${SVCNAME}"
+}
diff --git a/app-emulation/docker-registry/files/docker-registry-2.7.0-notification-metrics.patch b/app-emulation/docker-registry/files/docker-registry-2.7.0-notification-metrics.patch
new file mode 100644
index 000000000000..8adf364ce164
--- /dev/null
+++ b/app-emulation/docker-registry/files/docker-registry-2.7.0-notification-metrics.patch
@@ -0,0 +1,398 @@
+From 7b2292ee20c5d49053cc5262dfbc99ce121b9b74 Mon Sep 17 00:00:00 2001
+From: tifayuki <tifayuki@gmail.com>
+Date: Tue, 13 Feb 2018 13:30:56 -0800
+Subject: [PATCH 1/4] Add notification metrics
+
+It adds notification related prometheus metrics, including:
+ - total count for events/success/failure/error
+ - total count for notification per each status code
+ - gauge of the pending notification queue
+
+Signed-off-by: tifayuki <tifayuki@gmail.com>
+---
+ metrics/prometheus.go | 3 +++
+ notifications/metrics.go | 28 ++++++++++++++++++++++++++++
+ 2 files changed, 31 insertions(+)
+
+diff --git a/metrics/prometheus.go b/metrics/prometheus.go
+index b5a532144..91b32b23d 100644
+--- a/metrics/prometheus.go
++++ b/metrics/prometheus.go
+@@ -10,4 +10,7 @@ const (
+ var (
+ // StorageNamespace is the prometheus namespace of blob/cache related operations
+ StorageNamespace = metrics.NewNamespace(NamespacePrefix, "storage", nil)
++
++ // NotificationsNamespace is the prometheus namespace of notification related metrics
++ NotificationsNamespace = metrics.NewNamespace(NamespacePrefix, "notifications", nil)
+ )
+diff --git a/notifications/metrics.go b/notifications/metrics.go
+index a20af1687..69960e9cb 100644
+--- a/notifications/metrics.go
++++ b/notifications/metrics.go
+@@ -5,6 +5,18 @@ import (
+ "fmt"
+ "net/http"
+ "sync"
++
++ prometheus "github.com/docker/distribution/metrics"
++ "github.com/docker/go-metrics"
++)
++
++var (
++ // eventsCounter counts total events of incoming, success, failure, and errors
++ eventsCounter = prometheus.NotificationsNamespace.NewLabeledCounter("events", "The number of total events", "type")
++ // pendingGauge measures the pending queue size
++ pendingGauge = prometheus.NotificationsNamespace.NewGauge("pending", "The gauge of pending events in queue", metrics.Total)
++ // statusCounter counts the total notification call per each status code
++ statusCounter = prometheus.NotificationsNamespace.NewLabeledCounter("status", "The number of status code", "code")
+ )
+
+ // EndpointMetrics track various actions taken by the endpoint, typically by
+@@ -61,6 +73,9 @@ func (emsl *endpointMetricsHTTPStatusListener) success(status int, events ...Eve
+ defer emsl.safeMetrics.Unlock()
+ emsl.Statuses[fmt.Sprintf("%d %s", status, http.StatusText(status))] += len(events)
+ emsl.Successes += len(events)
++
++ statusCounter.WithValues(fmt.Sprintf("%d %s", status, http.StatusText(status))).Inc(1)
++ eventsCounter.WithValues("Successes").Inc(1)
+ }
+
+ func (emsl *endpointMetricsHTTPStatusListener) failure(status int, events ...Event) {
+@@ -68,12 +83,17 @@ func (emsl *endpointMetricsHTTPStatusListener) failure(status int, events ...Eve
+ defer emsl.safeMetrics.Unlock()
+ emsl.Statuses[fmt.Sprintf("%d %s", status, http.StatusText(status))] += len(events)
+ emsl.Failures += len(events)
++
++ statusCounter.WithValues(fmt.Sprintf("%d %s", status, http.StatusText(status))).Inc(1)
++ eventsCounter.WithValues("Failures").Inc(1)
+ }
+
+ func (emsl *endpointMetricsHTTPStatusListener) err(err error, events ...Event) {
+ emsl.safeMetrics.Lock()
+ defer emsl.safeMetrics.Unlock()
+ emsl.Errors += len(events)
++
++ eventsCounter.WithValues("Errors").Inc(1)
+ }
+
+ // endpointMetricsEventQueueListener maintains the incoming events counter and
+@@ -87,12 +107,17 @@ func (eqc *endpointMetricsEventQueueListener) ingress(events ...Event) {
+ defer eqc.Unlock()
+ eqc.Events += len(events)
+ eqc.Pending += len(events)
++
++ eventsCounter.WithValues("Events").Inc()
++ pendingGauge.Inc(1)
+ }
+
+ func (eqc *endpointMetricsEventQueueListener) egress(events ...Event) {
+ eqc.Lock()
+ defer eqc.Unlock()
+ eqc.Pending -= len(events)
++
++ pendingGauge.Dec(1)
+ }
+
+ // endpoints is global registry of endpoints used to report metrics to expvar
+@@ -149,4 +174,7 @@ func init() {
+ }))
+
+ registry.(*expvar.Map).Set("notifications", &notifications)
++
++ // register prometheus metrics
++ metrics.Register(prometheus.NotificationsNamespace)
+ }
+
+From 4497e40eda1e0024f055c09ab480b7816a1147b1 Mon Sep 17 00:00:00 2001
+From: Honglin Feng <tifayuki@gmail.com>
+Date: Thu, 11 Oct 2018 21:39:02 +0800
+Subject: [PATCH 2/4] add label to the metrics
+
+Signed-off-by: Honglin Feng <tifayuki@gmail.com>
+---
+ notifications/endpoint.go | 2 +-
+ notifications/http_test.go | 2 +-
+ notifications/metrics.go | 26 ++++++++++++++------------
+ notifications/sinks_test.go | 2 +-
+ 4 files changed, 17 insertions(+), 15 deletions(-)
+
+diff --git a/notifications/endpoint.go b/notifications/endpoint.go
+index a8a52d0c9..854f1dd6c 100644
+--- a/notifications/endpoint.go
++++ b/notifications/endpoint.go
+@@ -58,7 +58,7 @@ func NewEndpoint(name, url string, config EndpointConfig) *Endpoint {
+ endpoint.url = url
+ endpoint.EndpointConfig = config
+ endpoint.defaults()
+- endpoint.metrics = newSafeMetrics()
++ endpoint.metrics = newSafeMetrics(name)
+
+ // Configures the inmemory queue, retry, http pipeline.
+ endpoint.Sink = newHTTPSink(
+diff --git a/notifications/http_test.go b/notifications/http_test.go
+index de47f789e..b7845cf95 100644
+--- a/notifications/http_test.go
++++ b/notifications/http_test.go
+@@ -63,7 +63,7 @@ func TestHTTPSink(t *testing.T) {
+ })
+ server := httptest.NewTLSServer(serverHandler)
+
+- metrics := newSafeMetrics()
++ metrics := newSafeMetrics("")
+ sink := newHTTPSink(server.URL, 0, nil, nil,
+ &endpointMetricsHTTPStatusListener{safeMetrics: metrics})
+
+diff --git a/notifications/metrics.go b/notifications/metrics.go
+index 69960e9cb..4464edd8f 100644
+--- a/notifications/metrics.go
++++ b/notifications/metrics.go
+@@ -12,11 +12,11 @@ import (
+
+ var (
+ // eventsCounter counts total events of incoming, success, failure, and errors
+- eventsCounter = prometheus.NotificationsNamespace.NewLabeledCounter("events", "The number of total events", "type")
++ eventsCounter = prometheus.NotificationsNamespace.NewLabeledCounter("events", "The number of total events", "type", "to")
+ // pendingGauge measures the pending queue size
+- pendingGauge = prometheus.NotificationsNamespace.NewGauge("pending", "The gauge of pending events in queue", metrics.Total)
++ pendingGauge = prometheus.NotificationsNamespace.NewLabeledGauge("pending", "The gauge of pending events in queue", metrics.Total, "to")
+ // statusCounter counts the total notification call per each status code
+- statusCounter = prometheus.NotificationsNamespace.NewLabeledCounter("status", "The number of status code", "code")
++ statusCounter = prometheus.NotificationsNamespace.NewLabeledCounter("status", "The number of status code", "code", "to")
+ )
+
+ // EndpointMetrics track various actions taken by the endpoint, typically by
+@@ -34,14 +34,16 @@ type EndpointMetrics struct {
+ // safeMetrics guards the metrics implementation with a lock and provides a
+ // safe update function.
+ type safeMetrics struct {
++ EndpointName string
+ EndpointMetrics
+ sync.Mutex // protects statuses map
+ }
+
+ // newSafeMetrics returns safeMetrics with map allocated.
+-func newSafeMetrics() *safeMetrics {
++func newSafeMetrics(name string) *safeMetrics {
+ var sm safeMetrics
+ sm.Statuses = make(map[string]int)
++ sm.EndpointName = name
+ return &sm
+ }
+
+@@ -74,8 +76,8 @@ func (emsl *endpointMetricsHTTPStatusListener) success(status int, events ...Eve
+ emsl.Statuses[fmt.Sprintf("%d %s", status, http.StatusText(status))] += len(events)
+ emsl.Successes += len(events)
+
+- statusCounter.WithValues(fmt.Sprintf("%d %s", status, http.StatusText(status))).Inc(1)
+- eventsCounter.WithValues("Successes").Inc(1)
++ statusCounter.WithValues(fmt.Sprintf("%d %s", status, http.StatusText(status)), emsl.EndpointName).Inc(1)
++ eventsCounter.WithValues("Successes", emsl.EndpointName).Inc(1)
+ }
+
+ func (emsl *endpointMetricsHTTPStatusListener) failure(status int, events ...Event) {
+@@ -84,8 +86,8 @@ func (emsl *endpointMetricsHTTPStatusListener) failure(status int, events ...Eve
+ emsl.Statuses[fmt.Sprintf("%d %s", status, http.StatusText(status))] += len(events)
+ emsl.Failures += len(events)
+
+- statusCounter.WithValues(fmt.Sprintf("%d %s", status, http.StatusText(status))).Inc(1)
+- eventsCounter.WithValues("Failures").Inc(1)
++ statusCounter.WithValues(fmt.Sprintf("%d %s", status, http.StatusText(status)), emsl.EndpointName).Inc(1)
++ eventsCounter.WithValues("Failures", emsl.EndpointName).Inc(1)
+ }
+
+ func (emsl *endpointMetricsHTTPStatusListener) err(err error, events ...Event) {
+@@ -93,7 +95,7 @@ func (emsl *endpointMetricsHTTPStatusListener) err(err error, events ...Event) {
+ defer emsl.safeMetrics.Unlock()
+ emsl.Errors += len(events)
+
+- eventsCounter.WithValues("Errors").Inc(1)
++ eventsCounter.WithValues("Errors", emsl.EndpointName).Inc(1)
+ }
+
+ // endpointMetricsEventQueueListener maintains the incoming events counter and
+@@ -108,8 +110,8 @@ func (eqc *endpointMetricsEventQueueListener) ingress(events ...Event) {
+ eqc.Events += len(events)
+ eqc.Pending += len(events)
+
+- eventsCounter.WithValues("Events").Inc()
+- pendingGauge.Inc(1)
++ eventsCounter.WithValues("Events", eqc.EndpointName).Inc()
++ pendingGauge.WithValues(eqc.EndpointName).Inc(1)
+ }
+
+ func (eqc *endpointMetricsEventQueueListener) egress(events ...Event) {
+@@ -117,7 +119,7 @@ func (eqc *endpointMetricsEventQueueListener) egress(events ...Event) {
+ defer eqc.Unlock()
+ eqc.Pending -= len(events)
+
+- pendingGauge.Dec(1)
++ pendingGauge.WithValues(eqc.EndpointName).Dec(1)
+ }
+
+ // endpoints is global registry of endpoints used to report metrics to expvar
+diff --git a/notifications/sinks_test.go b/notifications/sinks_test.go
+index 06f88b2c9..4a69486b5 100644
+--- a/notifications/sinks_test.go
++++ b/notifications/sinks_test.go
+@@ -66,7 +66,7 @@ func TestBroadcaster(t *testing.T) {
+ func TestEventQueue(t *testing.T) {
+ const nevents = 1000
+ var ts testSink
+- metrics := newSafeMetrics()
++ metrics := newSafeMetrics("")
+ eq := newEventQueue(
+ // delayed sync simulates destination slower than channel comms
+ &delayedSink{
+
+From 73e4232b5171c2988b0daeea517aa07386e7945d Mon Sep 17 00:00:00 2001
+From: Honglin Feng <tifayuki@gmail.com>
+Date: Mon, 15 Oct 2018 19:50:38 +0800
+Subject: [PATCH 3/4] run go fmt
+
+Signed-off-by: Honglin Feng <tifayuki@gmail.com>
+---
+ registry/storage/driver/s3-aws/s3.go | 10 +++++-----
+ registry/storage/linkedblobstore.go | 16 ++++++++--------
+ registry/storage/linkedblobstore_test.go | 4 ++--
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/registry/storage/driver/s3-aws/s3.go b/registry/storage/driver/s3-aws/s3.go
+index 800435d01..9cd87dbab 100644
+--- a/registry/storage/driver/s3-aws/s3.go
++++ b/registry/storage/driver/s3-aws/s3.go
+@@ -476,11 +476,11 @@ func New(params DriverParameters) (*Driver, error) {
+ // }
+
+ d := &driver{
+- S3: s3obj,
+- Bucket: params.Bucket,
+- ChunkSize: params.ChunkSize,
+- Encrypt: params.Encrypt,
+- KeyID: params.KeyID,
++ S3: s3obj,
++ Bucket: params.Bucket,
++ ChunkSize: params.ChunkSize,
++ Encrypt: params.Encrypt,
++ KeyID: params.KeyID,
+ MultipartCopyChunkSize: params.MultipartCopyChunkSize,
+ MultipartCopyMaxConcurrency: params.MultipartCopyMaxConcurrency,
+ MultipartCopyThresholdSize: params.MultipartCopyThresholdSize,
+diff --git a/registry/storage/linkedblobstore.go b/registry/storage/linkedblobstore.go
+index de591c8a5..3fb1da26f 100644
+--- a/registry/storage/linkedblobstore.go
++++ b/registry/storage/linkedblobstore.go
+@@ -312,14 +312,14 @@ func (lbs *linkedBlobStore) newBlobUpload(ctx context.Context, uuid, path string
+ }
+
+ bw := &blobWriter{
+- ctx: ctx,
+- blobStore: lbs,
+- id: uuid,
+- startedAt: startedAt,
+- digester: digest.Canonical.Digester(),
+- fileWriter: fw,
+- driver: lbs.driver,
+- path: path,
++ ctx: ctx,
++ blobStore: lbs,
++ id: uuid,
++ startedAt: startedAt,
++ digester: digest.Canonical.Digester(),
++ fileWriter: fw,
++ driver: lbs.driver,
++ path: path,
+ resumableDigestEnabled: lbs.resumableDigestEnabled,
+ }
+
+diff --git a/registry/storage/linkedblobstore_test.go b/registry/storage/linkedblobstore_test.go
+index e0ffd2796..85376f715 100644
+--- a/registry/storage/linkedblobstore_test.go
++++ b/registry/storage/linkedblobstore_test.go
+@@ -162,8 +162,8 @@ type mockBlobDescriptorServiceFactory struct {
+ func (f *mockBlobDescriptorServiceFactory) BlobAccessController(svc distribution.BlobDescriptorService) distribution.BlobDescriptorService {
+ return &mockBlobDescriptorService{
+ BlobDescriptorService: svc,
+- t: f.t,
+- stats: f.stats,
++ t: f.t,
++ stats: f.stats,
+ }
+ }
+
+
+From 5c66b577b027e3b314680f245be4213a002fcee0 Mon Sep 17 00:00:00 2001
+From: Honglin Feng <tifayuki@gmail.com>
+Date: Mon, 15 Oct 2018 20:18:36 +0800
+Subject: [PATCH 4/4] run go fmt and goimports
+
+Signed-off-by: Honglin Feng <tifayuki@gmail.com>
+---
+ registry/storage/driver/s3-aws/s3.go | 10 +++++-----
+ registry/storage/linkedblobstore.go | 16 ++++++++--------
+ registry/storage/linkedblobstore_test.go | 4 ++--
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/registry/storage/driver/s3-aws/s3.go b/registry/storage/driver/s3-aws/s3.go
+index 9cd87dbab..800435d01 100644
+--- a/registry/storage/driver/s3-aws/s3.go
++++ b/registry/storage/driver/s3-aws/s3.go
+@@ -476,11 +476,11 @@ func New(params DriverParameters) (*Driver, error) {
+ // }
+
+ d := &driver{
+- S3: s3obj,
+- Bucket: params.Bucket,
+- ChunkSize: params.ChunkSize,
+- Encrypt: params.Encrypt,
+- KeyID: params.KeyID,
++ S3: s3obj,
++ Bucket: params.Bucket,
++ ChunkSize: params.ChunkSize,
++ Encrypt: params.Encrypt,
++ KeyID: params.KeyID,
+ MultipartCopyChunkSize: params.MultipartCopyChunkSize,
+ MultipartCopyMaxConcurrency: params.MultipartCopyMaxConcurrency,
+ MultipartCopyThresholdSize: params.MultipartCopyThresholdSize,
+diff --git a/registry/storage/linkedblobstore.go b/registry/storage/linkedblobstore.go
+index 3fb1da26f..de591c8a5 100644
+--- a/registry/storage/linkedblobstore.go
++++ b/registry/storage/linkedblobstore.go
+@@ -312,14 +312,14 @@ func (lbs *linkedBlobStore) newBlobUpload(ctx context.Context, uuid, path string
+ }
+
+ bw := &blobWriter{
+- ctx: ctx,
+- blobStore: lbs,
+- id: uuid,
+- startedAt: startedAt,
+- digester: digest.Canonical.Digester(),
+- fileWriter: fw,
+- driver: lbs.driver,
+- path: path,
++ ctx: ctx,
++ blobStore: lbs,
++ id: uuid,
++ startedAt: startedAt,
++ digester: digest.Canonical.Digester(),
++ fileWriter: fw,
++ driver: lbs.driver,
++ path: path,
+ resumableDigestEnabled: lbs.resumableDigestEnabled,
+ }
+
+diff --git a/registry/storage/linkedblobstore_test.go b/registry/storage/linkedblobstore_test.go
+index 85376f715..e0ffd2796 100644
+--- a/registry/storage/linkedblobstore_test.go
++++ b/registry/storage/linkedblobstore_test.go
+@@ -162,8 +162,8 @@ type mockBlobDescriptorServiceFactory struct {
+ func (f *mockBlobDescriptorServiceFactory) BlobAccessController(svc distribution.BlobDescriptorService) distribution.BlobDescriptorService {
+ return &mockBlobDescriptorService{
+ BlobDescriptorService: svc,
+- t: f.t,
+- stats: f.stats,
++ t: f.t,
++ stats: f.stats,
+ }
+ }
+