Skip to content
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

docs: Simplify example jq commands by removing pipes #18327

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions website/content/docs/connect/ca/consul.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ In order to use the Update CA Configuration HTTP endpoint, the private key and c
must be passed via JSON:

```shell-session
$ jq --null-input --arg key "$(cat root.key)" --arg cert "$(cat root.crt)" '
$ jq --null-input --rawfile key root.key --rawfile cert root.crt '
{
"Provider": "consul",
"Config": {
"LeafCertTTL": "72h",
"PrivateKey": $key,
"RootCert": $cert,
"PrivateKey": $key | sub("\\n$"; ""),
"RootCert": $cert | sub("\\n$"; ""),
"IntermediateCertTTL": "8760h"
}
}' > ca_config.json
Expand Down
6 changes: 3 additions & 3 deletions website/content/docs/ecs/manual/secure-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ script to the container.

# Obtain details from the task metadata
ECS_TASK_META=$(curl -s $ECS_CONTAINER_METADATA_URI_V4/task)
TASK_REGION=$(echo "$ECS_TASK_META" | jq -r .TaskARN | cut -d ':' -f 4)
TASK_ID=$(echo "$ECS_TASK_META" | jq -r .TaskARN | cut -d '/' -f 3)
CLUSTER_ARN=$(echo "$ECS_TASK_META" | jq -r .TaskARN | sed -E 's|:task/([^/]+).*|:cluster/\1|')
TASK_REGION=$(echo "$ECS_TASK_META" | jq --raw-output '.TaskARN / ":" | .[3]')
TASK_ID=$(echo "$ECS_TASK_META" | jq --raw-output '.TaskARN / "/" | .[2]')
CLUSTER_ARN=$(echo "$ECS_TASK_META" | jq --raw-output '.TaskARN | sub(":task/(?<cluster>[^/]+).*"; ":cluster/\(.cluster)")')

# Write the CA certs to a files in the shared volume
echo "$CONSUL_CACERT_PEM" > /consul/consul-ca-cert.pem
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/security/acl/auth-methods/oidc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ be tricky to debug why things aren't working. Some tips for setting up OIDC:
request to obtain a JWT that you can inspect. An example of how to decode the
JWT (in this case located in the `access_token` field of a JSON response):

cat jwt.json | jq --raw-output .access_token | cut -d. -f2 | base64 --decode
jq --raw-output '.access_token / "." | .[1] | @base64d' jwt.json

- The [`VerboseOIDCLogging`](#verboseoidclogging) option is available which
will log the received OIDC token if debug level logging is enabled. This can
Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/troubleshoot/common-errors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ There is a syntax error in your configuration file. If the error message doesn't
```shell-session
$ consul agent -server -config-file server.json
==> Error parsing server.json: invalid character '`' looking for beginning of value
$ cat server.json | jq .
$ jq . server.json
parse error: Invalid numeric literal at line 3, column 29
```

Expand Down