add more clarity in ci configuration comments regarding ratios vs percentages
This commit is contained in:
parent
e4ddfb411c
commit
6d27c94262
@ -157,7 +157,7 @@ When running dive with the environment variable `CI=true` then the dive UI will
|
|||||||
```
|
```
|
||||||
rules:
|
rules:
|
||||||
# If the efficiency is measured below X%, mark as failed.
|
# If the efficiency is measured below X%, mark as failed.
|
||||||
# Expressed as a percentage between 0-1.
|
# Expressed as a ratio between 0-1.
|
||||||
lowestEfficiency: 0.95
|
lowestEfficiency: 0.95
|
||||||
|
|
||||||
# If the amount of wasted space is at least X or larger than X, mark as failed.
|
# If the amount of wasted space is at least X or larger than X, mark as failed.
|
||||||
@ -166,7 +166,7 @@ rules:
|
|||||||
|
|
||||||
# If the amount of wasted space makes up for X% or more of the image, mark as failed.
|
# If the amount of wasted space makes up for X% or more of the image, mark as failed.
|
||||||
# Note: the base image layer is NOT included in the total image size.
|
# Note: the base image layer is NOT included in the total image size.
|
||||||
# Expressed as a percentage between 0-1; fails if the threshold is met or crossed.
|
# Expressed as a ratio between 0-1; fails if the threshold is met or crossed.
|
||||||
highestUserWastedPercent: 0.20
|
highestUserWastedPercent: 0.20
|
||||||
```
|
```
|
||||||
You can override the CI config path with the `--ci-config` option.
|
You can override the CI config path with the `--ci-config` option.
|
||||||
|
@ -52,9 +52,9 @@ func initCli() {
|
|||||||
rootCmd.Flags().StringVarP(&exportFile, "json", "j", "", "Skip the interactive TUI and write the layer analysis statistics to a given file.")
|
rootCmd.Flags().StringVarP(&exportFile, "json", "j", "", "Skip the interactive TUI and write the layer analysis statistics to a given file.")
|
||||||
rootCmd.Flags().StringVar(&ciConfigFile, "ci-config", ".dive-ci", "If CI=true in the environment, use the given yaml to drive validation rules.")
|
rootCmd.Flags().StringVar(&ciConfigFile, "ci-config", ".dive-ci", "If CI=true in the environment, use the given yaml to drive validation rules.")
|
||||||
|
|
||||||
rootCmd.Flags().String("lowestEfficiency", "0.9", "(only valid with --ci given) lowest allowable image efficiency, otherwise CI validation will fail.")
|
rootCmd.Flags().String("lowestEfficiency", "0.9", "(only valid with --ci given) lowest allowable image efficiency (as a ratio between 0-1), otherwise CI validation will fail.")
|
||||||
rootCmd.Flags().String("highestWastedBytes", "disabled", "(only valid with --ci given) highest allowable bytes wasted, otherwise CI validation will fail.")
|
rootCmd.Flags().String("highestWastedBytes", "disabled", "(only valid with --ci given) highest allowable bytes wasted, otherwise CI validation will fail.")
|
||||||
rootCmd.Flags().String("highestUserWastedPercent", "0.1", "(only valid with --ci given) highest allowable percentage of bytes wasted, otherwise CI validation will fail.")
|
rootCmd.Flags().String("highestUserWastedPercent", "0.1", "(only valid with --ci given) highest allowable percentage of bytes wasted (as a ratio between 0-1), otherwise CI validation will fail.")
|
||||||
|
|
||||||
for _, key := range []string{"lowestEfficiency", "highestWastedBytes", "highestUserWastedPercent"} {
|
for _, key := range []string{"lowestEfficiency", "highestWastedBytes", "highestUserWastedPercent"} {
|
||||||
if err := ciConfig.BindPFlag(fmt.Sprintf("rules.%s", key), rootCmd.Flags().Lookup(key)); err != nil {
|
if err := ciConfig.BindPFlag(fmt.Sprintf("rules.%s", key), rootCmd.Flags().Lookup(key)); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user