diff options
author | Aditya R <arajan@redhat.com> | 2022-08-25 12:10:53 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-08-26 16:53:40 +0530 |
commit | e00272cd99ec7ccfc73ccf1e67e123e98f2ab3f0 (patch) | |
tree | ae198b4f909b590d5ca732073400a3a6fea4265e /pkg/bindings | |
parent | b1247b62bddd96a02741499cc63427866290e5a1 (diff) | |
download | podman-e00272cd99ec7ccfc73ccf1e67e123e98f2ab3f0.tar.gz podman-e00272cd99ec7ccfc73ccf1e67e123e98f2ab3f0.tar.bz2 podman-e00272cd99ec7ccfc73ccf1e67e123e98f2ab3f0.zip |
remote: fix implementation of build with --userns=auto for API
`podman-remote` and Libpod API does not supports build with
`--userns=auto` since `IDMappingOptions` were not implemented for API
and bindings, following PR implements passing `IDMappingOptions` via
bindings to API.
Closes: https://github.com/containers/podman/issues/15476
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'pkg/bindings')
-rw-r--r-- | pkg/bindings/images/build.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index 2615bc516..8348ac54b 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -88,6 +88,13 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO } params.Set("additionalbuildcontexts", string(additionalBuildContextMap)) } + if options.IDMappingOptions != nil { + idmappingsOptions, err := jsoniter.Marshal(options.IDMappingOptions) + if err != nil { + return nil, err + } + params.Set("idmappingoptions", string(idmappingsOptions)) + } if buildArgs := options.Args; len(buildArgs) > 0 { bArgs, err := jsoniter.MarshalToString(buildArgs) if err != nil { |