Skip to content

Commit d4d9e80

Browse files
committed
cleanup, --include-distro-info build flag
Signed-off-by: Kyle Quest <[email protected]>
1 parent 8889f5e commit d4d9e80

File tree

12 files changed

+653
-393
lines changed

12 files changed

+653
-393
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ var BuildFlags = (append([]cli.Flag{
129129
cflag(FlagAppImageDockerfile),
130130
cflag(FlagIncludePathsCreportFile),
131131
cflag(FlagIncludeHealthcheck),
132+
cflag(FlagIncludeDistroInfo),
132133
cflag(FlagIncludeOSLibsNet),
133134
cflag(FlagIncludeSSHClient),
134135
cflag(FlagIncludeZoneInfo),
@@ -701,6 +702,7 @@ var CLI = &cli.Command{
701702
xc.Exit(-1)
702703
}
703704

705+
doIncludeDistroInfo := ctx.Bool(FlagIncludeDistroInfo)
704706
doIncludeHealthcheck := ctx.Bool(FlagIncludeHealthcheck)
705707

706708
doIncludeSSHClient := ctx.Bool(FlagIncludeSSHClient)
@@ -820,6 +822,7 @@ var CLI = &cli.Command{
820822
doIncludeShell,
821823
doIncludeWorkdir,
822824
doIncludeHealthcheck,
825+
doIncludeDistroInfo,
823826
includeLastImageLayers,
824827
doIncludeAppImageAll,
825828
appImageStartInstGroup,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ const (
4343
FlagIncludeHealthcheck = "include-healthcheck"
4444
FlagIncludeHealthcheckUsage = "Keep the HEALTHCHECK related artifacts"
4545

46+
FlagIncludeDistroInfo = "include-distro-info"
47+
FlagIncludeDistroInfoUsage = "Keep OS distro metadata"
48+
4649
//TBD
4750
FlagWorkdirExclude = "workdir-exclude"
4851
FlagWorkdirExcludeUsage = "Exclude filter for artifacts when working directory is included"
@@ -351,6 +354,12 @@ var Flags = map[string]cli.Flag{
351354
Usage: FlagIncludeHealthcheckUsage,
352355
EnvVars: []string{"DSLIM_INCLUDE_HEALTHCHECK"},
353356
},
357+
FlagIncludeDistroInfo: &cli.BoolFlag{
358+
Name: FlagIncludeDistroInfo,
359+
Value: false,
360+
Usage: FlagIncludeDistroInfoUsage,
361+
EnvVars: []string{"DSLIM_INCLUDE_DISTRO_INFO"},
362+
},
354363
////
355364
FlagIncludeSSHClient: &cli.BoolFlag{
356365
Name: FlagIncludeSSHClient,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func OnCommand(
124124
doIncludeShell bool,
125125
doIncludeWorkdir bool,
126126
doIncludeHealthcheck bool,
127+
doIncludeDistroInfo bool,
127128
includeLastImageLayers uint,
128129
doIncludeAppImageAll bool,
129130
appImageStartInstGroup int,
@@ -1095,6 +1096,7 @@ func OnCommand(
10951096
doIncludeShell,
10961097
doIncludeWorkdir,
10971098
doIncludeHealthcheck,
1099+
doIncludeDistroInfo,
10981100
doIncludeCertAll,
10991101
doIncludeCertBundles,
11001102
doIncludeCertDirs,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ var CommandFlagSuggestions = &command.FlagSuggestions{
123123
{Text: command.FullFlagName(FlagAppImageDockerfile), Description: FlagAppImageDockerfileUsage},
124124
{Text: command.FullFlagName(FlagIncludePathsCreportFile), Description: FlagIncludePathsCreportFileUsage},
125125
{Text: command.FullFlagName(FlagIncludeHealthcheck), Description: FlagIncludeHealthcheckUsage},
126+
{Text: command.FullFlagName(FlagIncludeDistroInfo), Description: FlagIncludeDistroInfoUsage},
126127
{Text: command.FullFlagName(FlagIncludeSSHClient), Description: FlagIncludeSSHClientUsage},
127128
{Text: command.FullFlagName(FlagIncludeOSLibsNet), Description: FlagIncludeOSLibsNetUsage},
128129
{Text: command.FullFlagName(FlagIncludeCertAll), Description: FlagIncludeCertAllUsage},
@@ -205,6 +206,7 @@ var CommandFlagSuggestions = &command.FlagSuggestions{
205206
command.FullFlagName(FlagIncludeExeFile): command.CompleteFile,
206207
command.FullFlagName(FlagIncludePathsCreportFile): command.CompleteFile,
207208
command.FullFlagName(FlagIncludeHealthcheck): command.CompleteBool,
209+
command.FullFlagName(FlagIncludeDistroInfo): command.CompleteBool,
208210
command.FullFlagName(FlagIncludeShell): command.CompleteBool,
209211
command.FullFlagName(FlagIncludeWorkdir): command.CompleteBool,
210212
command.FullFlagName(FlagIncludeAppImageAll): command.CompleteBool,

pkg/app/master/command/profile/handler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ func OnCommand(
258258
false, //doIncludeShell,
259259
false, //doIncludeWorkdir,
260260
false, //doIncludeHealthcheck
261+
false, //doIncludeDistroInfo
261262
false, //doIncludeCertAll
262263
false, //doIncludeCertBundles
263264
false, //doIncludeCertDirs

pkg/app/master/inspectors/container/container_inspector.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ type Inspector struct {
121121
DoIncludeShell bool
122122
DoIncludeWorkdir bool
123123
DoIncludeHealthcheck bool
124+
DoIncludeDistroInfo bool
124125
DoIncludeCertAll bool
125126
DoIncludeCertBundles bool
126127
DoIncludeCertDirs bool
@@ -204,6 +205,7 @@ func NewInspector(
204205
doIncludeShell bool,
205206
doIncludeWorkdir bool,
206207
doIncludeHealthcheck bool,
208+
doIncludeDistroInfo bool,
207209
doIncludeCertAll bool,
208210
doIncludeCertBundles bool,
209211
doIncludeCertDirs bool,
@@ -264,6 +266,7 @@ func NewInspector(
264266
DoIncludeShell: doIncludeShell,
265267
DoIncludeWorkdir: doIncludeWorkdir,
266268
DoIncludeHealthcheck: doIncludeHealthcheck,
269+
DoIncludeDistroInfo: doIncludeDistroInfo,
267270
DoIncludeCertAll: doIncludeCertAll,
268271
DoIncludeCertBundles: doIncludeCertBundles,
269272
DoIncludeCertDirs: doIncludeCertDirs,
@@ -842,6 +845,7 @@ func (i *Inspector) RunContainer() error {
842845
}
843846
}
844847

848+
cmd.IncludeDistroInfo = i.DoIncludeDistroInfo
845849
cmd.IncludeCertAll = i.DoIncludeCertAll
846850
cmd.IncludeCertBundles = i.DoIncludeCertBundles
847851
cmd.IncludeCertDirs = i.DoIncludeCertDirs

0 commit comments

Comments
 (0)