grafana / grizzly

A utility for managing Jsonnet dashboards against the Grafana API
https://grafana.github.io/grizzly/
Apache License 2.0
514 stars 66 forks source link

[Bug]: datasources always report diff when using secureJsonData #487

Closed chrisleavoy closed 3 weeks ago

chrisleavoy commented 4 weeks ago

Grizzly Version

0.4.7

Expected Behavior

grr diff should not report secureJsonData is missing. Its not actually missing, Grafana just hides secureJsonData from API responses. See also: https://grafana.github.io/grizzly/workflows/#:~:text=Note%3A%20Grizzly%20can%20pull%20datasources%2C%20but%20secure%20passwords%20won%E2%80%99t%20be%20included%20when%20pulled%20%2D%20these%20will%20need%20to%20be%20provided%20manually%20(either%20by%20editing%20into%20the%20downloaded%20YAML%20or%20pasting%20them%20in%20via%20the%20Grafana%20UI).

Actual Behavior

grr diff reports secureJsonData is missing. Example:

Datasource.cortex-vitess changes detected:
--- Remote
+++ Local
@@ -11,6 +11,8 @@
         prometheusType: Cortex
     name: cortex-vitess
     orgId: 1
+    secureJsonData:
+        basicAuthPassword: glc_ey...9
     secureJsonFields:
         basicAuthPassword: true
     type: prometheus

Steps to Reproduce

grr apply datasources.jsonnet
grr diff datasources.jsonnet
K-Phoen commented 3 weeks ago

A fix landed in main, thanks for submitting this issue 👍