Skip to content

Commit 22f2bf1

Browse files
committed
[trino] Fixing NOTES to avoid users committing their password
1 parent 09538ab commit 22f2bf1

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

charts/trino/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type: application
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 1.0.7
21+
version: 1.0.8
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to

charts/trino/templates/NOTES.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,25 @@
4545
{{- end }}
4646

4747
To use Trino with Python and the `trino` client (see [full doc](https://github.com/trinodb/trino-python-client)):
48+
49+
- First of all, setup the client using the commmand line:
4850
```bash
4951
pip install trino
52+
export TRINO_HOSTNAME={{ include "library-chart.service-url" . | quote }}
53+
export TRINO_USERNAME={{ .Values.security.username | quote }}
54+
export TRINO_PASSWORD={{ .Values.security.password | quote }}
5055
```
5156

57+
- Then, in your Python script:
5258
```python
59+
import os
5360
from trino.dbapi import connect
5461
from trino.auth import BasicAuthentication
5562

5663
conn = connect(
57-
host={{ include "library-chart.service-url" . | quote }},
64+
host=os.getenv('TRINO_HOSTNAME'),
5865
port="443",
59-
auth=BasicAuthentication("{{ .Values.security.username }}", "{{ .Values.security.password }}"),
66+
auth=BasicAuthentication(os.getenv('TRINO_USERNAME'), os.getenv('TRINO_PASSWORD')),
6067
catalog="{{ first $catalogs }}",
6168
{{- if gt (len $catalogs) 1 }}
6269
# Available catalogs:
@@ -67,7 +74,6 @@ conn = connect(
6774
schema="default"
6875
)
6976
cur = conn.cursor()
70-
print(cur.execute("CREATE TABLE IF NOT EXISTS test(key bigint)").fetchall())
7177
print(cur.execute("SHOW TABLES").fetchall())
7278
```
7379
{{- end -}}

0 commit comments

Comments
 (0)