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

roachprod: change file permissions on prom/grafana files to 0777 #84670

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions pkg/roachprod/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ sudo systemd-run --unit node_exporter --same-dir ./node_exporter`,
cfg.PrometheusNode,
yamlCfg,
"/tmp/prometheus/prometheus.yml",
0644,
0777,
); err != nil {
return nil, err
}
Expand Down Expand Up @@ -294,7 +294,8 @@ sudo apt-get update -qqy && sudo apt-get install -qqy grafana-enterprise && sudo
if err := c.RepeatRun(ctx, l,
os.Stdout,
os.Stderr, cfg.PrometheusNode, "permissions",
`sudo chmod 777 /etc/grafana/provisioning/datasources /etc/grafana/provisioning/dashboards /var/lib/grafana/dashboards`,
`sudo chmod 777 /etc/grafana/provisioning/dashboards/cockroach.yaml /etc/grafana/provisioning/datasources/prometheus.yaml
/etc/grafana/provisioning/datasources /etc/grafana/provisioning/dashboards /var/lib/grafana/dashboards`,
); err != nil {
return nil, err
}
Expand All @@ -307,7 +308,7 @@ datasources:
type: prometheus
uid: localprom
url: http://localhost:9090
`, "/etc/grafana/provisioning/datasources/prometheus.yaml", 0644); err != nil {
`, "/etc/grafana/provisioning/datasources/prometheus.yaml", 0777); err != nil {
return nil, err
}

Expand All @@ -321,7 +322,7 @@ providers:
type: file
options:
path: /var/lib/grafana/dashboards
`, "/etc/grafana/provisioning/dashboards/cockroach.yaml", 0644); err != nil {
`, "/etc/grafana/provisioning/dashboards/cockroach.yaml", 0777); err != nil {
return nil, err
}
for idx, u := range cfg.Grafana.DashboardURLs {
Expand Down