Skip to content

Commit

Permalink
Clarify the recordDiff default behavior
Browse files Browse the repository at this point in the history
Signed-off-by: mprahl <mprahl@users.noreply.github.com>
  • Loading branch information
mprahl committed May 21, 2024
1 parent 250ea4c commit b791c44
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
10 changes: 7 additions & 3 deletions api/v1/configurationpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,13 @@ type ObjectTemplate struct {
// +kubebuilder:pruning:PreserveUnknownFields
ObjectDefinition runtime.RawExtension `json:"objectDefinition"`

// RecordDiff specifies whether (and where) to log the diff between the object on the
// cluster and the objectDefinition in the policy. Defaults to "None" when the object kind is
// ConfigMap, OAuthAccessToken, OAuthAuthorizeTokens, Route, or Secret. Defaults to "InStatus" otherwise.
// RecordDiff specifies whether and where to log the difference between the object on the cluster
// and the `objectDefinition` in the policy. The supported options are `InStatus` to record the
// difference in the policy status field, `Log` to log the difference in the
// config-policy-controller pod, and `None` to not log the diff. The default value is `None` for
// object kinds that include sensitive data including `ConfigMap`, `OAuthAccessToken`,
// `OAuthAuthorizeTokens`, `Route`, and `Secret` or when a policy template references sensitive
// data. For all other kinds, the default value is `InStatus`.
RecordDiff RecordDiff `json:"recordDiff,omitempty"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
recordDiff:
description: |-
RecordDiff specifies whether (and where) to log the diff between the object on the
cluster and the objectDefinition in the policy. Defaults to "None" when the object kind is
ConfigMap, OAuthAccessToken, OAuthAuthorizeTokens, Route, or Secret. Defaults to "InStatus" otherwise.
RecordDiff specifies whether and where to log the difference between the object on the cluster
and the `objectDefinition` in the policy. The supported options are `InStatus` to record the
difference in the policy status field, `Log` to log the difference in the
config-policy-controller pod, and `None` to not log the diff. The default value is `None` for
object kinds that include sensitive data including `ConfigMap`, `OAuthAccessToken`,
`OAuthAuthorizeTokens`, `Route`, and `Secret` or when a policy template references sensitive
data. For all other kinds, the default value is `InStatus`.
enum:
- Log
- InStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,13 @@ spec:
x-kubernetes-preserve-unknown-fields: true
recordDiff:
description: |-
RecordDiff specifies whether (and where) to log the diff between the object on the
cluster and the objectDefinition in the policy. Defaults to "None" when the object kind is
ConfigMap, OAuthAccessToken, OAuthAuthorizeTokens, Route, or Secret. Defaults to "InStatus" otherwise.
RecordDiff specifies whether and where to log the difference between the object on the cluster
and the `objectDefinition` in the policy. The supported options are `InStatus` to record the
difference in the policy status field, `Log` to log the difference in the
config-policy-controller pod, and `None` to not log the diff. The default value is `None` for
object kinds that include sensitive data including `ConfigMap`, `OAuthAccessToken`,
`OAuthAuthorizeTokens`, `Route`, and `Secret` or when a policy template references sensitive
data. For all other kinds, the default value is `InStatus`.
enum:
- Log
- InStatus
Expand Down

0 comments on commit b791c44

Please sign in to comment.