remove not exist orig

This commit is contained in:
liwenjun 2024-06-17 17:28:08 +08:00 committed by openkylin-cibot
parent fd53d124d9
commit d6e61d9c9c
4 changed files with 106 additions and 8 deletions

12
debian/changelog vendored
View File

@ -1,3 +1,15 @@
docker.io (20.10.25+dfsg1-ok4) nile; urgency=medium
* Remove not exist orig.
-- liwenjun <liwenjun@kylinos.cn> Mon, 17 Jun 2024 17:30:12 +0800
docker.io (20.10.25+dfsg1-ok3) nile; urgency=medium
* Apply build patches.
-- liwenjun <liwenjun@kylinos.cn> Mon, 17 Jun 2024 17:03:12 +0800
docker.io (20.10.25+dfsg1-ok2) nile; urgency=medium docker.io (20.10.25+dfsg1-ok2) nile; urgency=medium
* Add debian/source/options. * Add debian/source/options.

10
debian/control vendored
View File

@ -3,12 +3,6 @@ Section: admin
Priority: optional Priority: optional
Standards-Version: 4.6.0 Standards-Version: 4.6.0
Maintainer: openKylin Developers <packaging@lists.openkylin.top> Maintainer: openKylin Developers <packaging@lists.openkylin.top>
XSBC-Original-Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
Uploaders: Arnaud Rebillout <arnaudr@kali.org>
,Dmitry Smirnov <onlyjob@debian.org>
,Tim Potter <tpot@hpe.com>
,Tianon Gravi <tianon@debian.org>
,Paul Tagliamonte <paultag@debian.org>
Build-Conflicts: golang-github-docker-docker-dev Build-Conflicts: golang-github-docker-docker-dev
Build-Depends: debhelper-compat (= 13) ,dh-apparmor ,dh-golang (>= 1.14~) Build-Depends: debhelper-compat (= 13) ,dh-apparmor ,dh-golang (>= 1.14~)
,bash-completion ,bash-completion
@ -132,8 +126,8 @@ Build-Depends: debhelper-compat (= 13) ,dh-apparmor ,dh-golang (>= 1.14~)
# ,golang-k8s-sigs-structured-merge-diff-dev # ,golang-k8s-sigs-structured-merge-diff-dev
,golang-k8s-sigs-yaml-dev ,golang-k8s-sigs-yaml-dev
Homepage: https://mobyproject.org Homepage: https://mobyproject.org
Vcs-Browser: https://salsa.debian.org/go-team/packages/docker Vcs-Browser: https://gitee.com/openkylin/docker.io
Vcs-Git: https://salsa.debian.org/go-team/packages/docker.git Vcs-Git: https://gitee.com/openkylin/docker.io.git
Rules-Requires-Root: no Rules-Requires-Root: no
XS-Go-Import-Path: github.com/docker/docker XS-Go-Import-Path: github.com/docker/docker

View File

@ -0,0 +1,91 @@
From: liwenjun <liwenjun@kylinos.cn>
Date: Mon, 17 Jun 2024 17:28:08 +0800
Subject: remove not exist orig
---
engine/distribution/xfer/download.go | 12 ++++++------
engine/distribution/xfer/download_test.go | 18 +++++++++---------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/engine/distribution/xfer/download.go b/engine/distribution/xfer/download.go
index 45eb366..29a5097 100644
--- a/engine/distribution/xfer/download.go
+++ b/engine/distribution/xfer/download.go
@@ -272,7 +272,7 @@ func (ldm *LayerDownloadManager) makeDownloadFunc(descriptor DownloadDescriptor,
downloadReader io.ReadCloser
size int64
err error
- retries int
+ attempt int = 1
)
defer descriptor.Close()
@@ -292,16 +292,16 @@ func (ldm *LayerDownloadManager) makeDownloadFunc(descriptor DownloadDescriptor,
default:
}
- retries++
- if _, isDNR := err.(DoNotRetry); isDNR || retries > ldm.maxDownloadAttempts {
- logrus.Errorf("Download failed after %d attempts: %v", retries, err)
+ if _, isDNR := err.(DoNotRetry); isDNR || attempt >= ldm.maxDownloadAttempts {
+ logrus.Errorf("Download failed after %d attempts: %v", attempt, err)
d.err = err
return
}
- logrus.Infof("Download failed, retrying (%d/%d): %v", retries, ldm.maxDownloadAttempts, err)
- delay := retries * 5
+ logrus.Infof("Download failed, retrying (%d/%d): %v", attempt, ldm.maxDownloadAttempts, err)
+ delay := attempt * 5
ticker := time.NewTicker(ldm.waitDuration)
+ attempt++
selectLoop:
for {
diff --git a/engine/distribution/xfer/download_test.go b/engine/distribution/xfer/download_test.go
index 0174177..cc36e16 100644
--- a/engine/distribution/xfer/download_test.go
+++ b/engine/distribution/xfer/download_test.go
@@ -216,7 +216,7 @@ func (d *mockDownloadDescriptor) Download(ctx context.Context, progressOutput pr
if d.retries < d.simulateRetries {
d.retries++
- return nil, 0, fmt.Errorf("simulating download attempt %d/%d", d.retries, d.simulateRetries)
+ return nil, 0, fmt.Errorf("simulating download attempt failure %d/%d", d.retries, d.simulateRetries)
}
return d.mockTarStream(), 0, nil
@@ -370,25 +370,25 @@ func TestMaxDownloadAttempts(t *testing.T) {
}{
{
name: "max-attempts=5, succeed at 2nd attempt",
- simulateRetries: 2,
+ simulateRetries: 1,
maxDownloadAttempts: 5,
},
{
name: "max-attempts=5, succeed at 5th attempt",
- simulateRetries: 5,
+ simulateRetries: 4,
maxDownloadAttempts: 5,
},
{
- name: "max-attempts=5, fail at 6th attempt",
- simulateRetries: 6,
+ name: "max-attempts=5, fail at 5th attempt",
+ simulateRetries: 5,
maxDownloadAttempts: 5,
- expectedErr: "simulating download attempt 5/6",
+ expectedErr: "simulating download attempt failure 5/5",
},
{
- name: "max-attempts=0, fail after 1 attempt",
+ name: "max-attempts=1, fail after 1 attempt",
simulateRetries: 1,
- maxDownloadAttempts: 0,
- expectedErr: "simulating download attempt 1/1",
+ maxDownloadAttempts: 1,
+ expectedErr: "simulating download attempt failure 1/1",
},
}
for _, tc := range tests {

View File

@ -26,3 +26,4 @@ test--skip-TestGetRootUIDGID.patch
test--skip-TestStateRunStop.patch test--skip-TestStateRunStop.patch
avoid-consul.patch avoid-consul.patch
engine-client-dummy-hostname.patch engine-client-dummy-hostname.patch
0029-remove-not-exist-orig.patch