mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
808_prototype
This commit is contained in:
parent
44d50c1cde
commit
61918d9826
4 changed files with 5 additions and 3 deletions
|
@ -20,6 +20,7 @@ spec:
|
|||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
status: {}
|
||||
spec:
|
||||
required:
|
||||
- rules
|
||||
|
|
|
@ -20,6 +20,7 @@ spec:
|
|||
validation:
|
||||
openAPIV3Schema:
|
||||
properties:
|
||||
status: {}
|
||||
spec:
|
||||
required:
|
||||
- rules
|
||||
|
|
|
@ -121,7 +121,7 @@ type Policy struct {
|
|||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
Spec Spec `json:"spec"`
|
||||
Status PolicyStatus `json:"status"`
|
||||
Status PolicyStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// Spec describes policy behavior by its rules
|
||||
|
@ -230,7 +230,7 @@ type CloneFrom struct {
|
|||
// PolicyStatus mostly contains statistics related to policy
|
||||
type PolicyStatus struct {
|
||||
// average time required to process the policy rules on a resource
|
||||
AvgExecutionTime string `json:"averageExecutionTime"`
|
||||
AvgExecutionTime string `json:"averageExecutionTime,omitempty"`
|
||||
// number of violations created by this policy
|
||||
ViolationCount int `json:"violationCount,omitempty"`
|
||||
// Count of rules that failed
|
||||
|
|
|
@ -80,7 +80,7 @@ func (s *Sync) Run(workers int, stopCh <-chan struct{}) {
|
|||
go s.updateStatusCache(stopCh)
|
||||
}
|
||||
|
||||
wait.Until(s.updatePolicyStatus, 2*time.Second, stopCh)
|
||||
wait.Until(s.updatePolicyStatus, 10*time.Second, stopCh)
|
||||
<-stopCh
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue