File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
experimental/apis/data/v0alpha1 Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ func (g *DataQuery) DeepCopyInto(out *DataQuery) {
246
246
out .additional = map [string ]any {}
247
247
if len (g .additional ) > 0 {
248
248
jj , err := json .Marshal (g .additional )
249
- if err ! = nil {
249
+ if err = = nil {
250
250
_ = json .Unmarshal (jj , & out .additional )
251
251
}
252
252
}
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ func TestParseQueriesIntoQueryDataRequest(t *testing.T) {
20
20
"spreadsheet": "spreadsheetID",
21
21
"datasourceId": 4,
22
22
"intervalMs": 30000,
23
- "maxDataPoints": 794
23
+ "maxDataPoints": 794,
24
+ "expr": "{filename=\"/var/log/docker/2e21a640173f1f3359e2a178905dad6b1b56e2da6e3d53dbdba0a1123cdcb4fe/json.log\"} | logfmt"
24
25
},
25
26
{
26
27
"refId": "Z",
@@ -75,6 +76,11 @@ func TestParseQueriesIntoQueryDataRequest(t *testing.T) {
75
76
}` , string (out ))
76
77
})
77
78
79
+ t .Run ("verify deep copy" , func (t * testing.T ) {
80
+ cpy := req .DeepCopy ()
81
+ require .Equal (t , req , cpy )
82
+ })
83
+
78
84
t .Run ("same results from either parser" , func (t * testing.T ) {
79
85
typed := & QueryDataRequest {}
80
86
err = json .Unmarshal (request , typed )
You can’t perform that action at this time.
0 commit comments