diff --git a/README.md b/README.md index d13b1b2..ea4f0f6 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ When running dive with the environment variable `CI=true` then the dive UI will ``` rules: # 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 # 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. # 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 ``` You can override the CI config path with the `--ci-config` option. diff --git a/cmd/root.go b/cmd/root.go index 0edc27b..2ed2534 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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().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("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"} { if err := ciConfig.BindPFlag(fmt.Sprintf("rules.%s", key), rootCmd.Flags().Lookup(key)); err != nil {