Skip to content

Commit 2f2ff17

Browse files
giuseppeclaude
andcommitted
libimage: pass UID/GID mappings through the pull path
Propagate UIDMap/GIDMap from CopyOptions to SystemContext in NewCopier so that the storage transport destination receives the mappings. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 21af9ed commit 2f2ff17

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

common/libimage/copier.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"go.podman.io/image/v5/transports"
2828
"go.podman.io/image/v5/types"
2929
"go.podman.io/storage"
30+
"go.podman.io/storage/pkg/idtools"
3031
)
3132

3233
const (
@@ -150,6 +151,13 @@ type CopyOptions struct {
150151
// an access token for the registry.
151152
IdentityToken string `json:"identitytoken,omitempty"`
152153

154+
// ----- ID Mapping ---------------------------------------------------
155+
156+
// UIDMap and GIDMap are used for setting up image layers with the
157+
// correct UID/GID mappings when pulling into storage.
158+
UIDMap []idtools.IDMap
159+
GIDMap []idtools.IDMap
160+
153161
// ----- internal -----------------------------------------------------
154162

155163
// Additional tags when creating or copying a docker-archive.
@@ -280,6 +288,9 @@ func NewCopier(options *CopyOptions, sc *types.SystemContext) (*Copier, error) {
280288
c.systemContext.CompressionLevel = options.CompressionLevel
281289
}
282290

291+
c.systemContext.UIDMap = options.UIDMap
292+
c.systemContext.GIDMap = options.GIDMap
293+
283294
// NOTE: for the sake of consistency it's called Oci* in the CopyOptions.
284295
c.systemContext.OCIAcceptUncompressedLayers = options.OciAcceptUncompressedLayers
285296

0 commit comments

Comments
 (0)