Skip to content

Commit 0d683a8

Browse files
committed
include-last-image-layers slim command flag
Signed-off-by: Kyle Quest <[email protected]>
1 parent 1d9f45a commit 0d683a8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

pkg/app/master/command/build/cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ var BuildFlags = (append([]cli.Flag{
122122
cflag(FlagIncludeExe),
123123
cflag(FlagIncludeShell),
124124
cflag(FlagIncludeWorkdir),
125+
cflag(FlagIncludeLastImageLayers),
125126
cflag(FlagIncludeAppImageAll),
126127
cflag(FlagAppImageStartInstGroup),
127128
cflag(FlagAppImageStartInst),
@@ -150,7 +151,6 @@ var BuildFlags = (append([]cli.Flag{
150151
cflag(FlagIncludeAppNextNodeModulesDir),
151152
cflag(FlagIncludeNodePackage),
152153
cflag(FlagKeepPerms),
153-
cflag(FlagPathPerms),
154154
cflag(FlagPathPermsFile),
155155
//"EXCLUDE" FLAGS - START
156156
cflag(FlagExcludePattern),
@@ -685,7 +685,7 @@ var CLI = &cli.Command{
685685
doIncludeShell := ctx.Bool(FlagIncludeShell)
686686

687687
doIncludeWorkdir := ctx.Bool(FlagIncludeWorkdir)
688-
includeLastImageLayers := uint(0)
688+
includeLastImageLayers := ctx.Uint(FlagIncludeLastImageLayers)
689689
doIncludeAppImageAll := ctx.Bool(FlagIncludeAppImageAll)
690690
appImageStartInstGroup := ctx.Int(FlagAppImageStartInstGroup)
691691
appImageStartInst := ctx.String(FlagAppImageStartInst)

pkg/app/master/command/build/flags.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const (
4747
FlagWorkdirExclude = "workdir-exclude"
4848
FlagWorkdirExcludeUsage = "Exclude filter for artifacts when working directory is included"
4949

50+
FlagIncludeLastImageLayers = "include-last-image-layers"
51+
FlagIncludeLastImageLayersUsage = "Keep all files from the last number of layers in the image"
52+
5053
FlagIncludeAppImageAddCopyAll = "include-app-image-addcopy-all" //TBD
5154
FlagIncludeAppImageRun = "include-app-image-run" //TBD
5255

@@ -457,6 +460,12 @@ var Flags = map[string]cli.Flag{
457460
Usage: FlagIncludeNodePackageUsage,
458461
EnvVars: []string{"DSLIM_INCLUDE_NODE_PKG"},
459462
},
463+
FlagIncludeLastImageLayers: &cli.UintFlag{
464+
Name: FlagIncludeLastImageLayers,
465+
Value: 0,
466+
Usage: FlagIncludeLastImageLayersUsage,
467+
EnvVars: []string{"DSLIM_INCLUDE_LAST_IMAGE_LAYERS"},
468+
},
460469
FlagKeepPerms: &cli.BoolFlag{
461470
Name: FlagKeepPerms,
462471
Value: true, //enabled by default

0 commit comments

Comments
 (0)