-
Notifications
You must be signed in to change notification settings - Fork 717
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
api_server_encryption_provider_cipher rule.yml has bad jsonpath #11099
Conversation
api_server_encryption_provider_cipher rule.yml has bad jsonpath Signed-off-by: Paul Bastide <pbastide@redhat.com>
Hi @prb112. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -76,7 +76,7 @@ ocil: |- | |||
API server to verify that its resources were successfully encrypted: | |||
<pre> | |||
# encrypt the etcd datastore | |||
$ oc get openshiftapiserver -o=jsonpath='{range.items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}' | |||
$ oc get openshiftapiserver -o=jsonpath='{range .items[0]}{.status.conditions[?(@.type=="Encrypted")].status}{"\n"}{end}' |
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.
@prb112 Hi,
The jsonpath itself is not wrong, but it doesn't show anything meaningful when etcd encryption is not configured.
Soon after encryption is configured it outputs the following:
oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'
EncryptionInProgress
Resource routes.route.openshift.io is not encrypted
And when it is completed:
oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}{"\n"}{.message}{"\n"}'
EncryptionCompleted
All resources encrypted: routes.route.openshift.io
How about adding .status
to the original jsonpath?
$ oc get openshiftapiserver -o=jsonpath='{range .items[0]}{.status.conditions[?(@.type=="Encrypted")].status}{"\n"}{end}' | |
$ oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.status}{"\n"}{.reason}{"\n"}{.message}{"\n"}{end} |
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 made the change on a4c0420
Modify oc jsonpath to more clearly show the status of etcd's encryption provider. This is relevant when no encryption is configured and reason and message are empty.
Code Climate has analyzed commit a4c0420 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 58.5%. View more on Code Climate. |
/hold for test |
Verification passed with 4.14.7 + compliance-operator from ComplianceAsCode
|
/unhold |
label /qe-approved |
Thanks @rhmdnd . |
Description:
Rationale:
Review Hints:
as-is
with fix:
@rhmdnd This might be you or @Vincent056 to review.