1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

Fix : failed to parse BACKGROUND_SCAN_INTERVAL log message wrong (#9933)

* Update policy_controller.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Signed-off-by: mohamedasifs123 <asifabu272@gmail.com>

* Update policy_controller.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Signed-off-by: mohamedasifs123 <asifabu272@gmail.com>

* Update policy_controller.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Signed-off-by: mohamedasifs123 <asifabu272@gmail.com>

* Update policy_controller.go

-s

Signed-off-by: mohamedasifs123 <asifabu272@gmail.com>

* Update policy_controller.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Signed-off-by: mohamedasifs123 <asifabu272@gmail.com>

* Update policy_controller.go

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Signed-off-by: mohamedasifs123 <asifabu272@gmail.com>

---------

Signed-off-by: mohamedasifs123 <142201466+mohamedasifs123@users.noreply.github.com>
Signed-off-by: mohamedasifs123 <asifabu272@gmail.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
mohamedasifs123 2024-06-05 15:35:31 +05:30 committed by GitHub
parent 12a2ba34b2
commit 97327fd31c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -159,7 +159,7 @@ func (pc *policyController) canBackgroundProcess(p kyvernov1.PolicyInterface) bo
val := os.Getenv("BACKGROUND_SCAN_INTERVAL")
interval, err := time.ParseDuration(val)
if err != nil {
logger.V(4).Info("failed to parse BACKGROUND_SCAN_INTERVAL env variable, falling to default 1h", "msg", err.Error())
logger.V(4).Info("The BACKGROUND_SCAN_INTERVAL env variable is not set, therefore the default interval of 1h will be used.", "msg", err.Error())
interval = time.Hour
}
if p.GetCreationTimestamp().Add(interval).After(time.Now()) {