diff --git a/controllers/datadogdashboard/controller.go b/controllers/datadogdashboard/controller.go index 4502bda92..dff8139a8 100644 --- a/controllers/datadogdashboard/controller.go +++ b/controllers/datadogdashboard/controller.go @@ -32,7 +32,7 @@ import ( const ( defaultRequeuePeriod = 60 * time.Second defaultErrRequeuePeriod = 5 * time.Second - defaultForceSyncPeriod = 30 * time.Second + defaultForceSyncPeriod = 60 * time.Minute datadogDashboardKind = "DatadogDashboard" datadogDashboardFinalizer = "finalizer.dashboard.datadoghq.com" ) diff --git a/controllers/datadogdashboard/dashboard.go b/controllers/datadogdashboard/dashboard.go index 7dd648531..e7dd94d52 100644 --- a/controllers/datadogdashboard/dashboard.go +++ b/controllers/datadogdashboard/dashboard.go @@ -45,14 +45,13 @@ func buildDashboard(logger logr.Logger, ddb *v1alpha1.DatadogDashboard) *datadog dbTemplateVariablePresets := []datadogV1.DashboardTemplateVariablePreset{} for _, variablePreset := range ddb.Spec.TemplateVariablePresets { dbTemplateVariablePreset := datadogV1.DashboardTemplateVariablePreset{} - // Name is required + // Note: Name is required. It can't be nil. dbTemplateVariablePreset.SetName(*variablePreset.Name) dbTemplateVariablePresetValues := []datadogV1.DashboardTemplateVariablePresetValue{} for _, presetValue := range variablePreset.TemplateVariables { dbTemplateVariablePresetValue := datadogV1.DashboardTemplateVariablePresetValue{} // Name is required dbTemplateVariablePresetValue.SetName(*presetValue.Name) - // NOTE: is it possible to assign nil here anyways? if presetValue.Values != nil { dbTemplateVariablePresetValue.SetValues(presetValue.Values) } @@ -73,13 +72,10 @@ func buildDashboard(logger logr.Logger, ddb *v1alpha1.DatadogDashboard) *datadog if dbTemplateVariable.Defaults != nil { dbTemplateVariable.SetDefaults(templateVariable.Defaults) } - // NOTE: Unsure about this nullableList behavior if templateVariable.AvailableValues.Value != nil { - // availableValues := datadog.NullableList[string]{} - // availableValues.Set(dbTemplateVariable.AvailableValues.Get()) dbTemplateVariable.SetAvailableValues(*templateVariable.AvailableValues.Value) } - // NOTE: since we can just set nullableString/List like so, perhaps change types to just make it a string? + // NOTE: since we can just set nullableString/List like so, perhaps change types to just make it a regular string/list? if templateVariable.Prefix.Value != nil { dbTemplateVariable.SetPrefix(*templateVariable.Prefix.Value) }