@@ -51,7 +51,7 @@ type LayoutItem struct {
5151}
5252
5353func DashConfigFromSLO (sloConf SLO ) (* SLODashboard , error ) {
54- sloName := sloConf .Metadata . Name
54+ sloName := sloConf .Name ()
5555 target := sloConf .Target ()
5656
5757 configYamlBytes , err := yaml .Marshal (sloConf )
@@ -79,7 +79,7 @@ func DashConfigFromSLO(sloConf SLO) (*SLODashboard, error) {
7979 StrYAMLConfig : string (configYamlBytes ),
8080 Labels : sloConf .Labels ,
8181 Fields : giveMapKeys (sloConf .Fields ),
82- ViewName : sloConf .ViewName ,
82+ ViewName : sloConf .ViewName () ,
8383 }
8484
8585 return conf , nil
@@ -315,33 +315,32 @@ var vizSettingHourlyBurn string
315315//go:embed templates/visual-settings/breakdown-panel.gojson
316316var vizSettingBreakdownPanel string
317317
318-
319318//go:embed templates/visual-settings/forecasted-panel.json
320319var vizSettingBudgetForecastPanel string
321320
322321func givePanelQuery (s SLO , key PanelKey ) (string , error ) {
323- //queryStr := givePanelQueryStr(key, s.ViewName)
322+ //queryStr := givePanelQueryStr(key, s.ViewName() )
324323 queryTmplStr := ""
325324 if s .Spec .BudgetingMethod == BudgetingMethodNameTimeSlices {
326- queryTmplStr = givePanelQueryTimesliceStr (key , s .ViewName )
325+ queryTmplStr = givePanelQueryTimesliceStr (key , s .ViewName () )
327326 } else {
328- queryTmplStr = givePanelQueryStr (key , s .ViewName )
327+ queryTmplStr = givePanelQueryStr (key , s .ViewName () )
329328 }
330329
331330 wherePart := giveWhereClause (giveMapKeys (s .Fields ))
332331
333332 tmplParams := struct {
334333 Target float64
335334 TimesliceRatioTarget float64
336- GroupByStr string
335+ GroupByStr string
337336 }{
338337 Target : s .Target (),
339338 TimesliceRatioTarget : s .TimesliceTarget (),
340- GroupByStr : giveFieldsGroupByStr (s .Fields ),
339+ GroupByStr : giveFieldsGroupByStr (s .Fields ),
341340 }
342341
343342 queryPart , err := GiveStrFromTmpl (queryTmplStr , tmplParams )
344- return fmt .Sprintf ("_view=%s %s %s" , s .ViewName , wherePart , queryPart ), err
343+ return fmt .Sprintf ("_view=%s %s %s" , s .ViewName () , wherePart , queryPart ), err
345344}
346345
347346func givePanelQueryStr (Key PanelKey , view string ) string {
0 commit comments