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

Add support for jsonpath to the CLI #127

Merged
merged 11 commits into from
May 26, 2022
18 changes: 9 additions & 9 deletions docs/content-development/generating.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,19 +407,19 @@ To test generated manifests you need to:

1. Get the status of the Action from the previous step:

```bash
capact act get redis
```
```bash
capact act get redis
```

In the STATUS column you can see the current status of the Action. When the Action workflow is being rendered by the Engine, you will see the BEING_RENDERED status. After the Action finished rendering and the status is `READY_TO_RUN`, you can go to the next step.
In the STATUS column you can see the current status of the Action. When the Action workflow is being rendered by the Engine, you will see the BEING_RENDERED status. After the Action finished rendering and the status is `READY_TO_RUN`, you can go to the next step.

1. Run the rendered Action

After the Action is in `READY_TO_RUN` status, you can run it. To do this, execute the following command:

```bash
capact act run redis
```
```bash
capact act run redis
```

1. Check the Action execution and wait till it is finished:

Expand All @@ -430,15 +430,15 @@ To test generated manifests you need to:
1. Get the ID of the `cap.type.database.redis.config` TypeInstance:

```bash
capact action get redis -ojson | jq -r '.Actions[].output.typeInstances | map(select(.typeRef.path == "cap.type.database.redis.config"))'
capact action get redis -ojsonpath -t '{.Actions[*].output.typeInstances[?(@.typeRef.path == "cap.type.database.redis.config")].id}'
```

1. Get the TypeInstance value:

Use the ID from the previous step and fetch the TypeInstance value:

```bash
capact typeinstance get {type-instance-id} -ojson | jq -r '.[0].latestResourceVersion.spec.value'
capact typeinstance get {type-instance-id} -ojsonpath -t '{[0].latestResourceVersion.spec.value}'
```

1. Use the information from the TypeInstance to connect to the Redis.
Expand Down
4 changes: 2 additions & 2 deletions docs/example/mattermost-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ As a result, all external solutions, such as Cloud SQL, have a lower priority, a
1. Get the ID of the `cap.type.productivity.mattermost.config` TypeInstance:

```bash
capact action get -n $NAMESPACE mattermost-install -ojson | jq -r '.Actions[].output.typeInstances | map(select(.typeRef.path == "cap.type.productivity.mattermost.config"))'
capact action get -n $NAMESPACE mattermost-install -ojsonpath -t '{.Actions[*].output.typeInstances[?(@.typeRef.path == "cap.type.productivity.mattermost.config")].id}'
```

1. Get the TypeInstance value:

Use the ID from the previous step and fetch the TypeInstance value:
```bash
capact typeinstance get {type-instance-id} -ojson | jq -r '.[0].latestResourceVersion.spec.value'
capact typeinstance get {type-instance-id} -ojsonpath -t '{[0].latestResourceVersion.spec.value}'
```

1. Open the Mattermost console using the **host** from the TypeInstance value, you got in the previous step.
Expand Down
21 changes: 13 additions & 8 deletions docs/feature/storage-backends/aws-secrets-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ Create AWS security credentials with `SecretsManagerReadWrite` policy.

1. Follow the [AWS Credentials TypeInstance creation](../../example/typeinstances.md#aws-credentials) guide to create and obtain ID of the newly created TypeInstance.

Export it as `TI_ID` environment variable:
Export it as `TI_ID` environment variable:

```bash
export TI_ID="{id}"
```
```bash
export TI_ID="{id}"
```

1. Update the [Global policy](../policies/global-policy.md) to inject the AWS credentials for the storage backend installation:

Expand Down Expand Up @@ -117,14 +117,19 @@ Create AWS security credentials with `SecretsManagerReadWrite` policy.
1. Get output TypeInstances:

```bash
capact act get aws-storage -n capact-system -ojson | jq '.Actions[0].output.typeInstances'
capact act get aws-storage -n capact-system -ojsonpath -t '{.Actions[0].output.typeInstances}'
```

Copy ID of the installed AWS storage backend:

```bash
capact act get aws-storage -n capact-system -ojsonpath -t '{.Actions[0].output.typeInstances[?(@ typeRef.path == "cap.type.aws.secrets-manager.storage")].id}'
```

See the details of the installed AWS storage backend:

```bash
AWS_SM_STORAGE_ID=$(capact act get aws-storage -n capact-system -ojson | jq '.Actions[0].output.typeInstances | map(select(.typeRef.path == "cap.type.aws.secrets-manager.storage"))[0].id' -r)
capact ti get $AWS_SM_STORAGE_ID -oyaml
capact ti get {AWS storage backend ID} -oyaml
```

## Use the storage backend
Expand Down Expand Up @@ -164,7 +169,7 @@ Now, you can run any Capact manifest and utilize the newly installed AWS Secrets
- verify the `backend.id` for output TypeInstances of a given Action:

```bash
capact act get {action Name} -ojson | jq '.Actions[0].output.typeInstances'`
capact act get {action Name} -ojsonpath -t '{.Actions[0].output.typeInstances}'
```

- see the AWS Secrets Manager UI to verify the TypeInstance value is stored externally.
Expand Down
Loading