Skip to content

Commit

Permalink
Use sed as alternative to jq (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
donatwork authored Aug 4, 2022
1 parent 362d5fd commit 9376fef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions content/docs/authorization/deployment/helm/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following CSM Authorization components are installed in the specified namesp
- role-service, which configures roles for tenants to be bound to
- storage-service, which configures backend storage arrays for the proxy-server to foward requests to

The folloiwng third-party components are installed in the specified namespace:
The following third-party components are installed in the specified namespace:
- redis, which stores data regarding tenants and their volume ownership, quota, and revokation status
- redis-commander, a web management tool for Redis

Expand Down Expand Up @@ -215,10 +215,10 @@ karavictl generate token --tenant Finance --insecure --addr tenant.csm-authoriza
}
```

With [jq](https://stedolan.github.io/jq/), you process the above response to filter the secret manifest. For example:
Process the above response to filter the secret manifest. For example using sed you can run the following:

```
karavictl generate token --tenant Finance --insecure --addr tenant.csm-authorization.com:30016 | jq -r '.Token'
karavictl generate token --tenant Finance --insecure --addr tenant.csm-authorization.com:30016 | sed -e 's/"Token": //' -e 's/[{}"]//g' -e 's/\\n/\n/g'
apiVersion: v1
kind: Secret
metadata:
Expand Down
4 changes: 2 additions & 2 deletions content/docs/authorization/deployment/rpm/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ After creating the role bindings, the next logical step is to generate the acces
```
echo === Generating token ===
karavictl generate token --tenant $TenantName --insecure --addr "grpc.${AuthorizationProxyHost}" | jq -r '.Token' > token.yaml
karavictl generate token --tenant $TenantName --insecure --addr "grpc.${AuthorizationProxyHost}" | sed -e 's/"Token": //' -e 's/[{}"]//g' -e 's/\\n/\n/g' > token.yaml
echo === Copy token to Driver Host ===
sshpass -p ${DriverHostPassword} scp token.yaml ${DriverHostVMUser}@{DriverHostVMIP}:/tmp/token.yaml
Expand Down Expand Up @@ -352,7 +352,7 @@ Replace the data in `config.yaml` under the `data` field with your new, encoded

>__Note__: If you are updating the signing secret, the tenants need to be updated with new tokens via the `karavictl generate token` command like so. The `--insecure` flag is only necessary if certificates were not provided in `$HOME/.karavi/config.json`
`karavictl generate token --tenant $TenantName --insecure --addr "grpc.${AuthorizationProxyHost}" | jq -r '.Token' > kubectl -n $namespace apply -f -`
`karavictl generate token --tenant $TenantName --insecure --addr "grpc.${AuthorizationProxyHost}" | sed -e 's/"Token": //' -e 's/[{}"]//g' -e 's/\\n/\n/g' | kubectl -n $namespace apply -f -`

## CSM for Authorization Proxy Server Dynamic Configuration Settings

Expand Down

0 comments on commit 9376fef

Please sign in to comment.