1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

feat: add rules to status (#3376)

* fix: configmap resource filters generated by helm does not account for namespace

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

* feat: add rules to status

Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>

Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2022-03-15 15:49:16 +01:00 committed by GitHub
parent cc807b383e
commit 9e623bbf6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14821 additions and 0 deletions

View file

@ -781,6 +781,9 @@ type PolicyStatus struct {
// Autogen contains autogen status information
// +optional
Autogen AutogenStatus `json:"autogen" yaml:"autogen"`
// Rules is a list of Rule instances. It contains original rules defined in the spec
// auto generated rules added for pod controllers
Rules []Rule `json:"rules,omitempty" yaml:"rules,omitempty"`
}
// AutogenStatus contains autogen status information.

View file

@ -723,6 +723,13 @@ func (in *PolicyList) DeepCopyObject() runtime.Object {
func (in *PolicyStatus) DeepCopyInto(out *PolicyStatus) {
*out = *in
in.Autogen.DeepCopyInto(&out.Autogen)
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]Rule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyStatus.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -685,6 +685,7 @@ func (m *webhookConfigManager) updateStatus(policy *kyverno.ClusterPolicy, statu
policyCopy.Status.Autogen.Requested = requested
policyCopy.Status.Autogen.Supported = supported
policyCopy.Status.Autogen.Activated = activated
policyCopy.Status.Rules = policy.Spec.Rules
if reflect.DeepEqual(policyCopy.Status, policy.Status) {
return nil
}