Skip to content

Commit

Permalink
Merge pull request #94986 from tkashem/audit-drop-managed-fields
Browse files Browse the repository at this point in the history
drop managed fields from audit entries
  • Loading branch information
k8s-ci-robot committed Nov 3, 2021
2 parents da707b6 + bbc5934 commit 904e972
Show file tree
Hide file tree
Showing 27 changed files with 1,011 additions and 255 deletions.
20 changes: 20 additions & 0 deletions staging/src/k8s.io/apiserver/pkg/apis/audit/types.go
Expand Up @@ -172,6 +172,15 @@ type Policy struct {
// be specified per rule in which case the union of both are omitted.
// +optional
OmitStages []Stage

// OmitManagedFields indicates whether to omit the managed fields of the request
// and response bodies from being written to the API audit log.
// This is used as a global default - a value of 'true' will omit the managed fileds,
// otherwise the managed fields will be included in the API audit log.
// Note that this can also be specified per rule in which case the value specified
// in a rule will override the global default.
// +optional
OmitManagedFields bool
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -232,6 +241,17 @@ type PolicyRule struct {
// An empty list means no restrictions will apply.
// +optional
OmitStages []Stage

// OmitManagedFields indicates whether to omit the managed fields of the request
// and response bodies from being written to the API audit log.
// - a value of 'true' will drop the managed fields from the API audit log
// - a value of 'false' indicates that the managed fileds should be included
// in the API audit log
// Note that the value, if specified, in this rule will override the global default
// If a value is not specified then the global default specified in
// Policy.OmitManagedFields will stand.
// +optional
OmitManagedFields *bool
}

// GroupResources represents resource kinds in an API group.
Expand Down
226 changes: 147 additions & 79 deletions staging/src/k8s.io/apiserver/pkg/apis/audit/v1/generated.pb.go

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions staging/src/k8s.io/apiserver/pkg/apis/audit/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions staging/src/k8s.io/apiserver/pkg/apis/audit/v1/types.go
Expand Up @@ -166,6 +166,15 @@ type Policy struct {
// be specified per rule in which case the union of both are omitted.
// +optional
OmitStages []Stage `json:"omitStages,omitempty" protobuf:"bytes,3,rep,name=omitStages"`

// OmitManagedFields indicates whether to omit the managed fields of the request
// and response bodies from being written to the API audit log.
// This is used as a global default - a value of 'true' will omit the managed fileds,
// otherwise the managed fields will be included in the API audit log.
// Note that this can also be specified per rule in which case the value specified
// in a rule will override the global default.
// +optional
OmitManagedFields bool `json:"omitManagedFields,omitempty" protobuf:"varint,4,opt,name=omitManagedFields"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -226,6 +235,17 @@ type PolicyRule struct {
// An empty list means no restrictions will apply.
// +optional
OmitStages []Stage `json:"omitStages,omitempty" protobuf:"bytes,8,rep,name=omitStages"`

// OmitManagedFields indicates whether to omit the managed fields of the request
// and response bodies from being written to the API audit log.
// - a value of 'true' will drop the managed fields from the API audit log
// - a value of 'false' indicates that the managed fileds should be included
// in the API audit log
// Note that the value, if specified, in this rule will override the global default
// If a value is not specified then the global default specified in
// Policy.OmitManagedFields will stand.
// +optional
OmitManagedFields *bool `json:"omitManagedFields,omitempty" protobuf:"varint,9,opt,name=omitManagedFields"`
}

// GroupResources represents resource kinds in an API group.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 904e972

Please sign in to comment.