-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small improvements to recordDiff #248
Small improvements to recordDiff #248
Conversation
44a8192
to
b791c44
Compare
api/v1/configurationpolicy_types.go
Outdated
// 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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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 specifies whether and where to log the difference between the object on the cluster | |
// and the `objectDefinition` parameter 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-controlle`r pod, and `None` to not log the difference. The default value is `None` for | |
// object kinds that include sensitive data including resources such as, `ConfigMap`, `OAuthAccessToken`, | |
// `OAuthAuthorizeTokens`, `Route`, and `Secret`, or when a policy template references sensitive | |
// data. For all other kinds, the default value is `InStatus`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to not use the resources such as
suggestion since I think it's already clear enough with just object kinds
.
`# This diff may contain sensitive data. The spec["object-templates"][%d]["recordDiff"] field must be set `+ | ||
`to "InStatus" for the diff to be recorded in the policy status. Consider existing access to the `+ | ||
`ConfigurationPolicy objects and the etcd encryption configuration before proceeding.`, | ||
objectTemplateIndex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the other syntax bold the parameters? Also for this statement, saying "changes" instead of "differences" is more clear. However, I like "differences" for the sake of consistency. The extra tick marks from is a bit confusing for me. To be specific and if it is supported, please monospace "spec", "object-templates.recordDiff", "InStatus", "ConfigurationPolicy"
`# This diff may contain sensitive data. The spec["object-templates"][%d]["recordDiff"] field must be set `+ | |
`to "InStatus" for the diff to be recorded in the policy status. Consider existing access to the `+ | |
`ConfigurationPolicy objects and the etcd encryption configuration before proceeding.`, | |
objectTemplateIndex, | |
`# This diff might contain sensitive data. The spec field, ["object-templates"][%d]["recordDiff"] fmust be set `+ | |
`to "InStatus" for the differences to be recorded in the policy status. Consider existing access to the `+ | |
`ConfigurationPolicy objects and the etcd encryption configuration before you proceed.`, | |
objectTemplateIndex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax of spec["object-templates"][%d]["recordDiff"]
is the JSON notation to access the field which is why it's specified this way. This would make sense to the user since they write their configuration policy in JSON or YAML (which is a superset of JSON).
d049c5c
to
e22b067
Compare
Thanks for the reviews @dhaiducek and @dockerymick . This is ready for another round. |
Signed-off-by: mprahl <mprahl@users.noreply.github.com>
This provides more context as to why it may be unsafe to enable it. Signed-off-by: mprahl <mprahl@users.noreply.github.com>
...s/kustomize_configurationpolicy/policy.open-cluster-management.io_configurationpolicies.yaml
Outdated
Show resolved
Hide resolved
deploy/crds/policy.open-cluster-management.io_configurationpolicies.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: mprahl <mprahl@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, mprahl The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8f2947e
into
open-cluster-management-io:main
See each commit for details.