@@ -4,12 +4,13 @@ import (
44 "context"
55 "strconv"
66
7+ "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
78 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
89)
910
1011func dataSourceSysdigMonitorTeam () * schema.Resource {
1112 return & schema.Resource {
12- Read : dataSourceSysdigMonitorTeamRead ,
13+ ReadContext : dataSourceSysdigMonitorTeamRead ,
1314 Schema : map [string ]* schema.Schema {
1415 "id" : {
1516 Type : schema .TypeString ,
@@ -70,6 +71,7 @@ func dataSourceSysdigMonitorTeam() *schema.Resource {
7071 "entrypoint" : {
7172 Type : schema .TypeList ,
7273 Computed : true ,
74+ Optional : true ,
7375 Elem : & schema.Resource {
7476 Schema : map [string ]* schema.Schema {
7577 "type" : {
@@ -91,21 +93,21 @@ func dataSourceSysdigMonitorTeam() *schema.Resource {
9193 }
9294}
9395
94- func dataSourceSysdigMonitorTeamRead (d * schema.ResourceData , meta interface {}) error {
96+ func dataSourceSysdigMonitorTeamRead (ctx context. Context , d * schema.ResourceData , meta interface {}) diag. Diagnostics {
9597 clients := meta .(SysdigClients )
9698 client , err := getMonitorTeamClient (clients )
9799 if err != nil {
98- return err
100+ return diag . FromErr ( err )
99101 }
100102
101103 id , err := strconv .Atoi (d .Get ("id" ).(string ))
102104 if err != nil {
103- return err
105+ return diag . FromErr ( err )
104106 }
105107
106- team , err := client .GetTeamById (context . Background () , id )
108+ team , err := client .GetTeamById (ctx , id )
107109 if err != nil {
108- return err
110+ return diag . FromErr ( err )
109111 }
110112
111113 d .SetId (strconv .Itoa (team .ID ))
0 commit comments