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. DetailsInstructions 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. |
| <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.
@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} |
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.