1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-30 19:35:06 +00:00

fix: detection of kyverno going down (#5055)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-10-19 12:06:48 +02:00 committed by GitHub
parent 749c1bab3b
commit eac23af077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,6 +94,9 @@ func (c *runtime) IsGoingDown() bool {
if err != nil {
return apierrors.IsNotFound(err)
}
if deployment.GetDeletionTimestamp() != nil {
return true
}
if deployment.Spec.Replicas != nil {
return *deployment.Spec.Replicas == 0
}