mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
feat: update descriptions of image verify cache flags (#8770)
* feat: update descriptions of image verify cache flags Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * Update cmd/internal/flag.go Co-authored-by: Chip Zoller <chipzoller@gmail.com> Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com> * Update cmd/internal/flag.go Co-authored-by: Chip Zoller <chipzoller@gmail.com> Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com> * Update cmd/internal/flag.go Co-authored-by: Chip Zoller <chipzoller@gmail.com> Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * feat: update description of imageVerifyCacheEnabled Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> --------- Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com> Co-authored-by: Chip Zoller <chipzoller@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
parent
d7ddabe9bc
commit
6ad156f5d0
2 changed files with 5 additions and 5 deletions
|
@ -114,9 +114,9 @@ func initRegistryClientFlags() {
|
|||
}
|
||||
|
||||
func initImageVerifyCacheFlags() {
|
||||
flag.BoolVar(&imageVerifyCacheEnabled, "imageVerifyCacheEnabled", true, "Whether to use a TTL cache for storing verified images.")
|
||||
flag.Int64Var(&imageVerifyCacheMaxSize, "imageVerifyCacheMaxSize", 1000, "Max size limit for the TTL cache, 0 means default 1000 size limit.")
|
||||
flag.DurationVar(&imageVerifyCacheTTLDuration, "imageVerifyCacheTTLDuration", 60*time.Minute, "Max TTL value for a cache, 0 means default 1 hour TTL.")
|
||||
flag.BoolVar(&imageVerifyCacheEnabled, "imageVerifyCacheEnabled", true, "Enable a TTL cache for verified images.")
|
||||
flag.Int64Var(&imageVerifyCacheMaxSize, "imageVerifyCacheMaxSize", 1000, "Maximum number of keys that can be stored in the TTL cache. Keys are a combination of policy elements along with the image reference. Default is 1000. 0 sets the value to default.")
|
||||
flag.DurationVar(&imageVerifyCacheTTLDuration, "imageVerifyCacheTTLDuration", 60*time.Minute, "Maximum TTL value for a cache expressed as duration. Default is 60m. 0 sets the value to default.")
|
||||
}
|
||||
|
||||
func initLeaderElectionFlags() {
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
const (
|
||||
defaultTTL = 1 * time.Hour
|
||||
deafultMaxSize = 1000
|
||||
defaultMaxSize = 1000
|
||||
)
|
||||
|
||||
type cache struct {
|
||||
|
@ -70,7 +70,7 @@ func WithCacheEnableFlag(b bool) Option {
|
|||
func WithMaxSize(s int64) Option {
|
||||
return func(c *cache) error {
|
||||
if s == 0 {
|
||||
s = deafultMaxSize
|
||||
s = defaultMaxSize
|
||||
}
|
||||
c.maxSize = s
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue