From f7751f367c746d8f4430fed78cea03b542f90a55 Mon Sep 17 00:00:00 2001 From: Damanpreet Singh Date: Mon, 28 Oct 2024 20:02:42 +0530 Subject: [PATCH] Don't set APP_CACHE_DIR if --no-cache is passed with apps dev build (#1603) --- internal/apps/builder/cnb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/apps/builder/cnb.go b/internal/apps/builder/cnb.go index 383c4cc5c..27c3785e0 100644 --- a/internal/apps/builder/cnb.go +++ b/internal/apps/builder/cnb.go @@ -92,7 +92,7 @@ func (b *CNBComponentBuilder) Build(ctx context.Context) (res ComponentBuilderRe }) } - if b.localCacheDir != "" { + if b.localCacheDir != "" && !b.baseComponentBuilder.noCache { mounts = append(mounts, mount.Mount{ Type: mount.TypeBind, Source: b.localCacheDir, @@ -348,7 +348,7 @@ func (b *CNBComponentBuilder) cnbEnv(ctx context.Context) ([]string, error) { envs = append(envs, "PREVIOUS_APP_IMAGE_URL="+b.AppImageOutputName()) } - if b.localCacheDir != "" { + if b.localCacheDir != "" && !b.baseComponentBuilder.noCache { envs = append(envs, "APP_CACHE_DIR="+cnbCacheDir) }