Skip to content

Commit

Permalink
reverted force sync period to 1 hour
Browse files Browse the repository at this point in the history
  • Loading branch information
Eokye committed Jul 26, 2024
1 parent 843512d commit c26da96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion controllers/datadogdashboard/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
8 changes: 2 additions & 6 deletions controllers/datadogdashboard/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down

0 comments on commit c26da96

Please sign in to comment.