rename flag `--whitelist-var-run` to `ignore-var-run` (#1668)
* rename flag * instead depcrecate * add normalize function
This commit is contained in:
parent
1ee4140024
commit
04fb2fd55e
|
|
@ -90,11 +90,6 @@ linters-settings:
|
||||||
min-len: 3
|
min-len: 3
|
||||||
# minimal occurrences count to trigger, 3 by default
|
# minimal occurrences count to trigger, 3 by default
|
||||||
min-occurrences: 3
|
min-occurrences: 3
|
||||||
#depguard:
|
|
||||||
# list-type: blacklist
|
|
||||||
# include-go-root: false
|
|
||||||
# packages:
|
|
||||||
# - github.com/davecgh/go-spew/spew
|
|
||||||
misspell:
|
misspell:
|
||||||
# Correct spellings using locale preferences for US or UK.
|
# Correct spellings using locale preferences for US or UK.
|
||||||
# Default is to use a neutral variety of English.
|
# Default is to use a neutral variety of English.
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ _If you are interested in contributing to kaniko, see [DEVELOPMENT.md](DEVELOPME
|
||||||
- [--target](#--target)
|
- [--target](#--target)
|
||||||
- [--use-new-run](#--use-new-run)
|
- [--use-new-run](#--use-new-run)
|
||||||
- [--verbosity](#--verbosity)
|
- [--verbosity](#--verbosity)
|
||||||
- [--whitelist-var-run](#--whitelist-var-run)
|
- [--ignore-var-run](#--ignore-var-run)
|
||||||
- [--ignore-path](#--ignore-path)
|
- [--ignore-path](#--ignore-path)
|
||||||
- [Debug Image](#debug-image)
|
- [Debug Image](#debug-image)
|
||||||
- [Security](#security)
|
- [Security](#security)
|
||||||
|
|
@ -745,7 +745,7 @@ Use the experimental run implementation for detecting changes without requiring
|
||||||
|
|
||||||
Set this flag as `--verbosity=<panic|fatal|error|warn|info|debug|trace>` to set the logging level. Defaults to `info`.
|
Set this flag as `--verbosity=<panic|fatal|error|warn|info|debug|trace>` to set the logging level. Defaults to `info`.
|
||||||
|
|
||||||
#### --whitelist-var-run
|
#### --ignore-var-run
|
||||||
|
|
||||||
Ignore /var/run when taking image snapshot. Set it to false to preserve /var/run/* in destination image. (Default true).
|
Ignore /var/run when taking image snapshot. Set it to false to preserve /var/run/* in destination image. (Default true).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,18 @@ func init() {
|
||||||
|
|
||||||
addKanikoOptionsFlags()
|
addKanikoOptionsFlags()
|
||||||
addHiddenFlags(RootCmd)
|
addHiddenFlags(RootCmd)
|
||||||
|
RootCmd.PersistentFlags().BoolVarP(&opts.IgnoreVarRun, "whitelist-var-run", "", true, "Ignore /var/run directory when taking image snapshot. Set it to false to preserve /var/run/ in destination image. (Default true).")
|
||||||
|
RootCmd.PersistentFlags().MarkDeprecated("whitelist-var-run", "please use ignore-var-run instead.")
|
||||||
|
RootCmd.PersistentFlags().SetNormalizeFunc(normalizeWhitelistVarRun)
|
||||||
|
}
|
||||||
|
|
||||||
|
func normalizeWhitelistVarRun(f *pflag.FlagSet, name string) pflag.NormalizedName {
|
||||||
|
switch name {
|
||||||
|
case "whitelist-var-run":
|
||||||
|
name = "ignore-var-run"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return pflag.NormalizedName(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RootCmd is the kaniko command that is run
|
// RootCmd is the kaniko command that is run
|
||||||
|
|
@ -196,7 +208,7 @@ func addKanikoOptionsFlags() {
|
||||||
opts.RegistriesCertificates = make(map[string]string)
|
opts.RegistriesCertificates = make(map[string]string)
|
||||||
RootCmd.PersistentFlags().VarP(&opts.RegistriesCertificates, "registry-certificate", "", "Use the provided certificate for TLS communication with the given registry. Expected format is 'my.registry.url=/path/to/the/server/certificate'.")
|
RootCmd.PersistentFlags().VarP(&opts.RegistriesCertificates, "registry-certificate", "", "Use the provided certificate for TLS communication with the given registry. Expected format is 'my.registry.url=/path/to/the/server/certificate'.")
|
||||||
RootCmd.PersistentFlags().VarP(&opts.RegistryMirrors, "registry-mirror", "", "Registry mirror to use as pull-through cache instead of docker.io. Set it repeatedly for multiple mirrors.")
|
RootCmd.PersistentFlags().VarP(&opts.RegistryMirrors, "registry-mirror", "", "Registry mirror to use as pull-through cache instead of docker.io. Set it repeatedly for multiple mirrors.")
|
||||||
RootCmd.PersistentFlags().BoolVarP(&opts.IgnoreVarRun, "whitelist-var-run", "", true, "Ignore /var/run directory when taking image snapshot. Set it to false to preserve /var/run/ in destination image. (Default true).")
|
RootCmd.PersistentFlags().BoolVarP(&opts.IgnoreVarRun, "ignore-var-run", "", true, "Ignore /var/run directory when taking image snapshot. Set it to false to preserve /var/run/ in destination image. (Default true).")
|
||||||
RootCmd.PersistentFlags().VarP(&opts.Labels, "label", "", "Set metadata for an image. Set it repeatedly for multiple labels.")
|
RootCmd.PersistentFlags().VarP(&opts.Labels, "label", "", "Set metadata for an image. Set it repeatedly for multiple labels.")
|
||||||
RootCmd.PersistentFlags().BoolVarP(&opts.SkipUnusedStages, "skip-unused-stages", "", false, "Build only used stages if defined to true. Otherwise it builds by default all stages, even the unnecessaries ones until it reaches the target stage / end of Dockerfile")
|
RootCmd.PersistentFlags().BoolVarP(&opts.SkipUnusedStages, "skip-unused-stages", "", false, "Build only used stages if defined to true. Otherwise it builds by default all stages, even the unnecessaries ones until it reaches the target stage / end of Dockerfile")
|
||||||
RootCmd.PersistentFlags().BoolVarP(&opts.RunV2, "use-new-run", "", false, "Use the experimental run implementation for detecting changes without requiring file system snapshots.")
|
RootCmd.PersistentFlags().BoolVarP(&opts.RunV2, "use-new-run", "", false, "Use the experimental run implementation for detecting changes without requiring file system snapshots.")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue