Skip to content

Commit 224a932

Browse files
authored
Merge branch 'main' into fix-snapshot-path-description
2 parents c81694b + 1f491dd commit 224a932

File tree

3 files changed

+49
-5
lines changed

3 files changed

+49
-5
lines changed

cmd/kosli/createPolicy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ const createPolicyLongDesc = `Updating policy content creates a new version of t
1515

1616
const createPolicyExample = `
1717
# create a Kosli policy:
18-
kosli create policy yourPolicyName \
18+
kosli create policy yourPolicyName yourPolicyFile.yml \
1919
--description yourPolicyDescription \
20-
--type environment \
20+
--type env \
2121
--api-token yourAPIToken \
2222
--org yourOrgName
2323
2424
# update a Kosli policy:
25-
kosli create policy yourFlowName \
25+
kosli create policy yourPolicyName yourPolicyFile.yml \
2626
--description yourPolicyDescription \
27-
--type environment \
27+
--type env \
2828
--comment yourChangeComment \
2929
--api-token yourAPIToken \
3030
--org yourOrgName

docs.kosli.com/content/faq/_index.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,50 @@ env:
7878
KOSLI_API_TOKEN: ${{ secrets.kosli_api_token }}
7979
```
8080

81+
## I'm running the Kosli CLI in a subshell and the captured output includes stderr!
82+
83+
The Kosli CLI writes debug information to `stderr`, and all other output to `stdout`.
84+
Normally, in a bash $(subshell), only `stdout` is captured.
85+
In the following example, the `DIGEST` variable captures _only_ the 64 character digest of the docker image;
86+
the extra debug information is printed to the terminal.
87+
88+
```shell {.command}
89+
# In a local terminal
90+
KOSLI_DEBUG=true
91+
DIGEST="$(kosli fingerprint "${IMAGE_NAME}" --artifact-type=docker)"
92+
93+
[debug] calculated fingerprint: 2c6079df58292ed10e8074adcb74be549b7f841a1bd8266f06bb5c518643193e for artifact: 244531986313.dkr.ecr.eu-central-1.amazonaws.com/exercises-start-points:86f9052
94+
95+
echo "DIGEST=${DIGEST}"
96+
DIGEST=2c6079df58292ed10e8074adcb74be549b7f841a1bd8266f06bb5c518643193e
97+
```
98+
99+
However, in many CI workflows (including Github and Gitlab), `stdout` and `stderr` are multiplexed together.
100+
This means `DIGEST` will contain _both_ the 64 character digest _and_ the debug information.
101+
For example:
102+
103+
```shell {.command}
104+
# In a CI workflow
105+
KOSLI_DEBUG=true
106+
DIGEST="$(kosli fingerprint "${IMAGE_NAME}" --artifact-type=docker)"
107+
108+
echo "DIGEST=${DIGEST}"
109+
DIGEST=[debug] calculated fingerprint: 2c6079df58292ed10e8074adcb74be549b7f841a1bd8266f06bb5c518643193e for artifact: 244531986313.dkr.ecr.eu-central-1.amazonaws.com/exercises-start-points:86f9052
110+
2c6079df58292ed10e8074adcb74be549b7f841a1bd8266f06bb5c518643193e
111+
```
112+
113+
When running the Kosli CLI in a subshell, in a CI workflow, we recommend explicitly setting the `--debug` flag to false.
114+
115+
```shell {.command}
116+
# In a CI workflow
117+
KOSLI_DEBUG=true
118+
DIGEST="$(kosli fingerprint "${IMAGE_NAME}" --artifact-type=docker --debug=false)"
119+
120+
echo "DIGEST=${DIGEST}"
121+
DIGEST=2c6079df58292ed10e8074adcb74be549b7f841a1bd8266f06bb5c518643193e
122+
```
123+
124+
81125
## Where can I find API documentation?
82126

83127
Kosli API documentation is available for logged in Kosli users here: https://app.kosli.com/api/v2/doc/

docs.kosli.com/layouts/partials/docs/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h3 class="h5-style">Stuck with something?</h3>
4444
<img src="/images/kosli-logo.svg" alt="Kosli Logo">
4545
</div>
4646
<div>
47-
© 2023 Kosli Inc.
47+
© 2025 Kosli Inc.
4848
</div>
4949
<div>
5050
<a href="https://www.kosli.com" target="_blank">kosli.com</a>

0 commit comments

Comments
 (0)