summaryrefslogtreecommitdiff
path: root/pkg/bindings/images
diff options
context:
space:
mode:
authorAditya Rajan <arajan@redhat.com>2021-11-25 17:10:50 +0530
committerAditya Rajan <arajan@redhat.com>2021-11-30 14:19:17 +0530
commitbfcaf538bb000d7eb72975d234a95f566da54715 (patch)
treeb29573ec5d5bad840e794969b2a387c0a2f76622 /pkg/bindings/images
parentd51ebca0c17cb69d2e5dfa45a5e2392e0afbd05e (diff)
downloadpodman-bfcaf538bb000d7eb72975d234a95f566da54715.tar.gz
podman-bfcaf538bb000d7eb72975d234a95f566da54715.tar.bz2
podman-bfcaf538bb000d7eb72975d234a95f566da54715.zip
api: allow build api to accept secrets
Following commit makes sure that `build` api can accept external secret and allows currently `NOOP` `podman-remote build -t tag --secret id=mysecret,src=/path/on/remote` to become functional. Just like `docker` following api is a hidden field and only exposed to `podman-remote` but could document it if it needs exposed on `swagger`. Signed-off-by: Aditya Rajan <arajan@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r--pkg/bindings/images/build.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go
index 3b0bebe9f..9c2e3e6b2 100644
--- a/pkg/bindings/images/build.go
+++ b/pkg/bindings/images/build.go
@@ -116,6 +116,13 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
}
params.Add("dnsservers", c)
}
+ if secrets := options.CommonBuildOpts.Secrets; len(secrets) > 0 {
+ c, err := jsoniter.MarshalToString(secrets)
+ if err != nil {
+ return nil, err
+ }
+ params.Add("secrets", c)
+ }
if dnsoptions := options.CommonBuildOpts.DNSOptions; len(dnsoptions) > 0 {
c, err := jsoniter.MarshalToString(dnsoptions)
if err != nil {