Skip to content

Commit

Permalink
Update resource_datadog_dashboard.go
Browse files Browse the repository at this point in the history
  • Loading branch information
RobThomas02 authored Oct 8, 2024
1 parent 271c36a commit 9ad7c1a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions datadog/resource_datadog_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -2302,6 +2302,24 @@ func getDistributionDefinitionSchema() map[string]*schema.Schema {
Optional: true,
},
"live_span": getWidgetLiveSpanSchema(),
"xaxis": {
Description: "A nested block describing the X-Axis Controls. Exactly one nested block is allowed using the structure below.",
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Elem: &schema.Resource{
Schema: getWidgetAxisSchema(),
},
},
"yaxis": {
Description: "A nested block describing the Y-Axis Controls. Exactly one nested block is allowed using the structure below.",
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Elem: &schema.Resource{
Schema: getWidgetAxisSchema(),
},
},
}
}
func buildDatadogDistributionDefinition(terraformDefinition map[string]interface{}) *datadogV1.DistributionWidgetDefinition {
Expand Down Expand Up @@ -2330,6 +2348,16 @@ func buildDatadogDistributionDefinition(terraformDefinition map[string]interface
WidgetLegacyLiveSpan: &datadogV1.WidgetLegacyLiveSpan{LiveSpan: datadogV1.WidgetLiveSpan(ls).Ptr()},
}
}
if axis, ok := terraformDefinition["xaxis"].([]interface{}); ok && len(axis) > 0 {
if v, ok := axis[0].(map[string]interface{}); ok && len(v) > 0 {
datadogDefinition.Xaxis = buildDatadogWidgetAxis(v)

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / linter-checks

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment

Check failure on line 2353 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetXAxis value in assignment
}
}
if axis, ok := terraformDefinition["yaxis"].([]interface{}); ok && len(axis) > 0 {
if v, ok := axis[0].(map[string]interface{}); ok && len(v) > 0 {
datadogDefinition.Yaxis = buildDatadogWidgetAxis(v)

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / linter-checks

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment

Check failure on line 2358 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use buildDatadogWidgetAxis(v) (value of type *datadogV1.WidgetAxis) as *datadogV1.DistributionWidgetYAxis value in assignment
}
}
return datadogDefinition
}
func buildTerraformDistributionDefinition(datadogDefinition *datadogV1.DistributionWidgetDefinition) map[string]interface{} {
Expand Down Expand Up @@ -2357,6 +2385,14 @@ func buildTerraformDistributionDefinition(datadogDefinition *datadogV1.Distribut

terraformDefinition["live_span"] = v.WidgetLegacyLiveSpan.GetLiveSpan()
}
if v, ok := datadogDefinition.GetXaxisOk(); ok {
axis := buildTerraformWidgetAxis(*v)

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / linter-checks

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2389 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetXAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis
terraformDefinition["xaxis"] = []map[string]interface{}{axis}
}
if v, ok := datadogDefinition.GetYaxisOk(); ok {
axis := buildTerraformWidgetAxis(*v)

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / linter-checks

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test-tofu

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis

Check failure on line 2393 in datadog/resource_datadog_dashboard.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

cannot use *v (variable of type datadogV1.DistributionWidgetYAxis) as datadogV1.WidgetAxis value in argument to buildTerraformWidgetAxis
terraformDefinition["yaxis"] = []map[string]interface{}{axis}
}
return terraformDefinition
}

Expand Down

0 comments on commit 9ad7c1a

Please sign in to comment.