Skip to content

Commit a693da9

Browse files
committed
respect ui naming for entrypoint
1 parent 564fb32 commit a693da9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

sysdig/resource_sysdig_monitor_team.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func resourceSysdigMonitorTeam() *schema.Resource {
111111
"type": {
112112
Type: schema.TypeString,
113113
Required: true,
114-
ValidateFunc: validation.StringInSlice([]string{"Explore", "Dashboards", "Events", "Alerts", "Settings", "DashboardTemplates", "Overview"}, false),
114+
ValidateFunc: validation.StringInSlice([]string{"Explore", "Dashboards", "Events", "Alerts", "Settings", "DashboardTemplates", "Advisor"}, false),
115115
},
116116

117117
"selection": {
@@ -235,8 +235,12 @@ func entrypointToSet(entrypoint *v2.EntryPoint) (res []map[string]interface{}) {
235235
return
236236
}
237237

238+
module := entrypoint.Module
239+
if module == "Overview" {
240+
module = "Advisor"
241+
}
238242
entrypointMap := map[string]interface{}{
239-
"type": entrypoint.Module,
243+
"type": module,
240244
"selection": entrypoint.Selection,
241245
}
242246
return append(res, entrypointMap)
@@ -309,6 +313,9 @@ func teamFromResourceData(d *schema.ResourceData, clientType ClientType) v2.Team
309313

310314
t.EntryPoint = &v2.EntryPoint{}
311315
t.EntryPoint.Module = d.Get("entrypoint.0.type").(string)
316+
if t.EntryPoint.Module == "Advisor" {
317+
t.EntryPoint.Module = "Overview"
318+
}
312319
if val, ok := d.GetOk("entrypoint.0.selection"); ok {
313320
t.EntryPoint.Selection = val.(string)
314321
}

website/docs/r/monitor_team.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ data "sysdig_custom_role" "custom_role" {
8383
### Entrypoint Argument Reference
8484

8585
* `type` - (Required) Main entrypoint for the team.
86-
Valid options are: `Explore`, `Dashboards`, `Events`, `Alerts`, `Settings`, `DashboardTemplates`, `Overview`.
86+
Valid options are: `Explore`, `Dashboards`, `Events`, `Alerts`, `Settings`, `DashboardTemplates`, `Advisor`.
8787

8888
* `selection` - (Optional) Sets up the defined Dashboard name as entrypoint.
8989
Warning: This field must only be added if the `type` is `Dashboards`, and the value is the numeric id of the selected dashboard, or `DashboardTemplates`, and the value is the id (dotted name) of the selected dashboard template.

0 commit comments

Comments
 (0)