mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-08 18:15:48 +00:00
527 fixed violation count and generated count
This commit is contained in:
parent
157694b4fd
commit
8a12ea30d6
2 changed files with 8 additions and 2 deletions
|
@ -36,12 +36,16 @@ func (sc StatusControl) Failed(gr kyverno.GenerateRequest, message string, genRe
|
|||
|
||||
// Success sets the gr status.state to completed and clears message
|
||||
func (sc StatusControl) Success(gr kyverno.GenerateRequest, genResources []kyverno.ResourceSpec) error {
|
||||
grCopy := gr.DeepCopy()
|
||||
|
||||
gr.Status.State = kyverno.Completed
|
||||
gr.Status.Message = ""
|
||||
// Update Generated Resources
|
||||
gr.Status.GeneratedResources = genResources
|
||||
|
||||
go sc.policyStatus.UpdatePolicyStatusWithGeneratedResourceCount(gr)
|
||||
if grCopy.Status.State != kyverno.Completed {
|
||||
go sc.policyStatus.UpdatePolicyStatusWithGeneratedResourceCount(gr)
|
||||
}
|
||||
|
||||
_, err := sc.client.KyvernoV1().GenerateRequests("kyverno").UpdateStatus(&gr)
|
||||
if err != nil {
|
||||
|
|
|
@ -234,7 +234,9 @@ func (gen *Generator) syncHandler(info Info) error {
|
|||
pv := builder.generate(info)
|
||||
|
||||
if info.FromSync {
|
||||
pv.Annotations["fromSync"] = "true"
|
||||
pv.Annotations = map[string]string{
|
||||
"fromSync": "true",
|
||||
}
|
||||
}
|
||||
|
||||
// Create Policy Violations
|
||||
|
|
Loading…
Add table
Reference in a new issue