Skip to content

Commit

Permalink
feat: update descriptions of image verify cache flags (kyverno#8770) (k…
Browse files Browse the repository at this point in the history
…yverno#8822)

* feat: update descriptions of image verify cache flags



* Update cmd/internal/flag.go




* Update cmd/internal/flag.go




* Update cmd/internal/flag.go




* feat: update description of imageVerifyCacheEnabled



---------

Signed-off-by: Vishal Choudhary <[email protected]>
Signed-off-by: Vishal Choudhary <[email protected]>
Co-authored-by: Vishal Choudhary <[email protected]>
Co-authored-by: Chip Zoller <[email protected]>
Co-authored-by: shuting <[email protected]>
  • Loading branch information
4 people authored Nov 2, 2023
1 parent 2ede6e8 commit a44c43b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cmd/internal/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/imageverifycache/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
defaultTTL = 1 * time.Hour
deafultMaxSize = 1000
defaultMaxSize = 1000
)

type cache struct {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a44c43b

Please sign in to comment.