From 59cb410fe29d18d2e908762d80f3caf1cd5a41a4 Mon Sep 17 00:00:00 2001 From: Aditya R Date: Tue, 9 Aug 2022 09:10:55 +0530 Subject: build: implement --cache-to,--cache-from and --cache-ttl [NO NEW TESTS NEEDED] [NO TESTS NEEDED] Signed-off-by: Aditya R --- pkg/bindings/images/build.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/bindings') diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index 6883585e2..2615bc516 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -224,6 +224,15 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO if len(options.Manifest) > 0 { params.Set("manifest", options.Manifest) } + if options.CacheFrom != nil { + params.Set("cachefrom", options.CacheFrom.String()) + } + if options.CacheTo != nil { + params.Set("cacheto", options.CacheTo.String()) + } + if int64(options.CacheTTL) != 0 { + params.Set("cachettl", options.CacheTTL.String()) + } if memSwap := options.CommonBuildOpts.MemorySwap; memSwap > 0 { params.Set("memswap", strconv.Itoa(int(memSwap))) } -- cgit v1.2.3-54-g00ecf