mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
0c2a88638b
* fix: properly use useCache field in image verification policies Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * fix: add test Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> * fix: revert client changes Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> --------- Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com> Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
18 lines
714 B
Go
18 lines
714 B
Go
package imageverifycache
|
|
|
|
import (
|
|
"context"
|
|
|
|
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
|
|
)
|
|
|
|
type Client interface {
|
|
// Set Adds an image to the cache. The image is considered to be verified for the given rule in the policy
|
|
// The entry outomatically expires after sometime
|
|
// Returns true when the cache entry is added
|
|
Set(ctx context.Context, policy kyvernov1.PolicyInterface, ruleName string, imageRef string, useCache bool) (bool, error)
|
|
|
|
// Get Searches for the image verified using the rule in the policy in the cache
|
|
// Returns true when the cache entry is found
|
|
Get(ctx context.Context, policy kyvernov1.PolicyInterface, ruleName string, imagerRef string, useCache bool) (bool, error)
|
|
}
|