@@ -14,6 +14,7 @@ import (
1414 "github.com/hashicorp/terraform-plugin-testing/helper/resource"
1515 "github.com/stretchr/testify/require"
1616
17+ "github.com/coder/coder/v2/coderd/util/ptr"
1718 "github.com/coder/coder/v2/codersdk"
1819 "github.com/coder/terraform-provider-coderd/integration"
1920)
@@ -49,21 +50,21 @@ func TestAccTemplateDataSource(t *testing.T) {
4950 Description : "An example template" ,
5051 Icon : "/path/to/icon.png" ,
5152 VersionID : version .ID ,
52- DefaultTTLMillis : PtrTo ((10 * time .Hour ).Milliseconds ()),
53- ActivityBumpMillis : PtrTo ((4 * time .Hour ).Milliseconds ()),
53+ DefaultTTLMillis : ptr . Ref ((10 * time .Hour ).Milliseconds ()),
54+ ActivityBumpMillis : ptr . Ref ((4 * time .Hour ).Milliseconds ()),
5455 AutostopRequirement : & codersdk.TemplateAutostopRequirement {
5556 DaysOfWeek : []string {"sunday" },
5657 Weeks : 1 ,
5758 },
5859 AutostartRequirement : & codersdk.TemplateAutostartRequirement {
5960 DaysOfWeek : []string {"monday" , "tuesday" , "wednesday" , "thursday" , "friday" , "saturday" , "sunday" },
6061 },
61- AllowUserCancelWorkspaceJobs : PtrTo (true ),
62- AllowUserAutostart : PtrTo (true ),
63- AllowUserAutostop : PtrTo (true ),
64- FailureTTLMillis : PtrTo ((1 * time .Hour ).Milliseconds ()),
65- TimeTilDormantMillis : PtrTo ((7 * 24 * time .Hour ).Milliseconds ()),
66- TimeTilDormantAutoDeleteMillis : PtrTo ((30 * 24 * time .Hour ).Milliseconds ()),
62+ AllowUserCancelWorkspaceJobs : ptr . Ref (true ),
63+ AllowUserAutostart : ptr . Ref (true ),
64+ AllowUserAutostop : ptr . Ref (true ),
65+ FailureTTLMillis : ptr . Ref ((1 * time .Hour ).Milliseconds ()),
66+ TimeTilDormantMillis : ptr . Ref ((7 * 24 * time .Hour ).Milliseconds ()),
67+ TimeTilDormantAutoDeleteMillis : ptr . Ref ((30 * 24 * time .Hour ).Milliseconds ()),
6768 DisableEveryoneGroupAccess : true ,
6869 RequireActiveVersion : true ,
6970 })
@@ -93,9 +94,9 @@ func TestAccTemplateDataSource(t *testing.T) {
9394 UpdateWorkspaceLastUsedAt : false ,
9495 UpdateWorkspaceDormantAt : false ,
9596 RequireActiveVersion : tpl .RequireActiveVersion ,
96- DeprecationMessage : PtrTo ("This template is deprecated" ),
97+ DeprecationMessage : ptr . Ref ("This template is deprecated" ),
9798 DisableEveryoneGroupAccess : true ,
98- MaxPortShareLevel : PtrTo (codersdk .WorkspaceAgentPortShareLevelOwner ),
99+ MaxPortShareLevel : ptr . Ref (codersdk .WorkspaceAgentPortShareLevelOwner ),
99100 })
100101 require .NoError (t , err )
101102
@@ -153,8 +154,8 @@ func TestAccTemplateDataSource(t *testing.T) {
153154 cfg := testAccTemplateDataSourceConfig {
154155 URL : client .URL .String (),
155156 Token : client .SessionToken (),
156- OrganizationID : PtrTo (orgID .String ()),
157- Name : PtrTo (tpl .Name ),
157+ OrganizationID : ptr . Ref (orgID .String ()),
158+ Name : ptr . Ref (tpl .Name ),
158159 }
159160 resource .Test (t , resource.TestCase {
160161 IsUnitTest : true ,
@@ -173,7 +174,7 @@ func TestAccTemplateDataSource(t *testing.T) {
173174 cfg := testAccTemplateDataSourceConfig {
174175 URL : client .URL .String (),
175176 Token : client .SessionToken (),
176- ID : PtrTo (tpl .ID .String ()),
177+ ID : ptr . Ref (tpl .ID .String ()),
177178 }
178179 resource .Test (t , resource.TestCase {
179180 IsUnitTest : true ,
@@ -210,7 +211,7 @@ func TestAccTemplateDataSource(t *testing.T) {
210211 cfg := testAccTemplateDataSourceConfig {
211212 URL : client .URL .String (),
212213 Token : client .SessionToken (),
213- Name : PtrTo (tpl .Name ),
214+ Name : ptr . Ref (tpl .Name ),
214215 }
215216 resource .Test (t , resource.TestCase {
216217 IsUnitTest : true ,
0 commit comments