Merge ~aluria/grafana-snap/+git/grafana-snap:fix/cliplugins into grafana-snap:master

Proposed by Alvaro Uria
Status: Rejected
Rejected by: Alvaro Uria
Proposed branch: ~aluria/grafana-snap/+git/grafana-snap:fix/cliplugins
Merge into: grafana-snap:master
Diff against target: 15 lines (+4/-1)
1 file modified
bin/grafana-cli.wrapper (+4/-1)
Reviewer Review Type Date Requested Status
Alvaro Uria (community) Disapprove
Review via email: mp+409302@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alvaro Uria (aluria) wrote :

The envvar was correct. GF_PLUGIN_DIR affects grafana-cli. The envvars for the grafana service are not applicable to grafana-cli.

Hence, I've rejected the MP.

Revision history for this message
Alvaro Uria (aluria) :
review: Disapprove
Revision history for this message
Alvaro Uria (aluria) wrote :

root@focal:~# cat /snap/grafana/current/bin/grafana-cli.wrapper
#!/bin/sh
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH
export GF_PLUGIN_DIR=$SNAP_COMMON/data/plugins

exec "$SNAP/bin/grafana-cli" "$@"
root@focal:~# grafana.grafana-cli plugins install voxter-app
installing voxter-app @ 0.0.2
from: https://grafana.com/api/plugins/voxter-app/versions/0.0.2/download
into: /var/snap/grafana/common/data/plugins

✔ Installed voxter-app successfully

Restart grafana after installing plugins . <service grafana-server restart>

Unmerged commits

309b576... by Alvaro Uria

Update grafana-cli.wrapper envvars

The grafana service already uses the correct environment variables that
override changes in grafana.ini. However, the grafana-cli wrapper did
not use the same environment variables, causing the install of plugins
to use the default folder for non-snap packages. This change amends the
mistake.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/grafana-cli.wrapper b/bin/grafana-cli.wrapper
2index e98c138..a2dece0 100755
3--- a/bin/grafana-cli.wrapper
4+++ b/bin/grafana-cli.wrapper
5@@ -1,6 +1,9 @@
6 #!/bin/sh
7 export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
8 export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH
9-export GF_PLUGIN_DIR=$SNAP_COMMON/data/plugins
10+export GF_PATHS_DATA=$SNAP_COMMON/data
11+export GF_PATHS_LOGS=$SNAP_COMMON/data/log
12+export GF_PATHS_PLUGINS=$SNAP_COMMON/data/plugins
13+export GF_PATHS_PROVISIONING=$SNAP_COMMON/conf/provisioning
14
15 exec "$SNAP/bin/grafana-cli" "$@"

Subscribers

People subscribed via source and target branches

to all changes: