!101 Don't check source exists with CreateMountpoint

From: @dog-life 
Reviewed-by: @xu_lei_123 
Signed-off-by: @xu_lei_123
This commit is contained in:
openeuler-ci-bot 2024-11-14 08:21:59 +00:00 committed by Gitee
commit 39b15a96f2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From a72294a6688d747dcfec8751c3e2616cad703a31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= <pawel.gronowski@docker.com>
Date: Mon, 19 Feb 2024 15:16:07 +0100
Subject: [PATCH] mounts/validate: Don't check source exists with
CreateMountpoint
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Don't error out when mount source doesn't exist and mounts has
`CreateMountpoint` option enabled.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 05b883bdc836a2fd621452f58a2a2c02d253718c)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
---
volume/mounts/linux_parser.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/volume/mounts/linux_parser.go b/volume/mounts/linux_parser.go
index 1b64c23935..e7e8ad80f3 100644
--- a/volume/mounts/linux_parser.go
+++ b/volume/mounts/linux_parser.go
@@ -85,7 +85,9 @@ func (p *linuxParser) validateMountConfigImpl(mnt *mount.Mount, validateBindSour
if err != nil {
return &errMountConfig{mnt, err}
}
- if !exists {
+
+ createMountpoint := mnt.BindOptions != nil && mnt.BindOptions.CreateMountpoint
+ if !exists && !createMountpoint {
return &errMountConfig{mnt, errBindSourceDoesNotExist(mnt.Source)}
}
}
--
2.33.0

View File

@ -7,7 +7,7 @@
Name: docker
Version: 25.0.3
Release: 17
Release: 18
Summary: The open-source application container engine
License: ASL 2.0
URL: https://www.docker.com
@ -29,6 +29,7 @@ Patch0006: 0006-tini.c-a-function-declaration-without-a-prototype-is.patch
Patch0007: 0007-fix-libnetwork-osl-test-TestAddRemoveInterface.patch
Patch0008: 0008-api-omit-missing-Created-field-from-ImageInspect-res.patch
Patch0009: 0009-integration-Add-container-output-utility.patch
Patch0010: 0010-mounts-validate-Don-t-check-source-exists-with-Creat.patch
Requires(meta): %{name}-engine = %{version}-%{release}
Requires(meta): %{name}-client = %{version}-%{release}
@ -101,6 +102,7 @@ Docker client binary and related utilities
%patch 0007 -p1
%patch 0008 -p1
%patch 0009 -p1
%patch 0010 -p1
%setup -q -T -n %{_source_docker_init} -b 2
%patch 0006 -p1
@ -205,6 +207,9 @@ fi
%systemd_postun_with_restart docker.service
%changelog
* Fri Nov 08 2024 shechenglong <shechenglong@xfusion.com> - 25.0.3-18
- DESC: Don't check source exists with CreateMountpoint
* Fri Nov 08 2024 shechenglong <shechenglong@xfusion.com> - 25.0.3-17
- DESC: move group creation into pre section rather than post section
change requires into meta dependency for its actual use