@@ -24,7 +24,6 @@ import (
2424 corev1 "k8s.io/api/core/v1"
2525 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2626 "k8s.io/apimachinery/pkg/types"
27- "k8s.io/utils/ptr"
2827)
2928
3029func createTempKeyFile (content string ) (string , error ) {
@@ -85,12 +84,12 @@ func TestCreateApplication(t *testing.T) {
8584 SubPath : "/my/app" ,
8685 Revision : "superbug" ,
8786 },
88- Size : ptr . To ("mini" ),
87+ Size : new ("mini "),
8988 Hosts : []string {"custom.example.org" , "custom2.example.org" },
90- Port : ptr . To (int32 (1337 )),
89+ Port : new (int32 (1337 )),
9190 HealthProbe : healthProbe {PeriodSeconds : int32 (7 ), Path : "/he" },
92- Replicas : ptr . To (int32 (42 )),
93- BasicAuth : ptr . To (false ),
91+ Replicas : new (int32 (42 )),
92+ BasicAuth : new (false ),
9493 Env : map [string ]string {"hello" : "world" },
9594 BuildEnv : map [string ]string {"BP_GO_TARGETS" : "./cmd/web-server" },
9695 DeployJob : deployJob {Command : "date" , Name : "print-date" , Retries : 2 , Timeout : time .Minute },
@@ -124,8 +123,8 @@ func TestCreateApplication(t *testing.T) {
124123 Wait : false ,
125124 Name : "basic-auth" ,
126125 },
127- Size : ptr . To ("mini" ),
128- BasicAuth : ptr . To (true ),
126+ Size : new ("mini "),
127+ BasicAuth : new (true ),
129128 SkipRepoAccessCheck : true ,
130129 },
131130 checkApp : func (t * testing.T , cmd applicationCmd , app * apps.Application ) {
@@ -139,8 +138,8 @@ func TestCreateApplication(t *testing.T) {
139138 cmd : applicationCmd {
140139 Git : gitConfig {
141140 URL : "https://github.com/ninech/doesnotexist.git" ,
142- Username : ptr . To ("deploy" ),
143- Password : ptr . To ("hunter2" ),
141+ Username : new ("deploy "),
142+ Password : new ("hunter2 "),
144143 },
145144 resourceCmd : resourceCmd {
146145 Wait : false ,
@@ -170,7 +169,7 @@ func TestCreateApplication(t *testing.T) {
170169 Wait : false ,
171170 Name : "ssh-key-auth" ,
172171 },
173- Size : ptr . To ("mini" ),
172+ Size : new ("mini "),
174173 SkipRepoAccessCheck : true ,
175174 },
176175 checkApp : func (t * testing.T , cmd applicationCmd , app * apps.Application ) {
@@ -194,7 +193,7 @@ func TestCreateApplication(t *testing.T) {
194193 Wait : false ,
195194 Name : "ssh-key-auth-ed25519" ,
196195 },
197- Size : ptr . To ("mini" ),
196+ Size : new ("mini "),
198197 SkipRepoAccessCheck : true ,
199198 },
200199 checkApp : func (t * testing.T , cmd applicationCmd , app * apps.Application ) {
@@ -212,13 +211,13 @@ func TestCreateApplication(t *testing.T) {
212211 cmd : applicationCmd {
213212 Git : gitConfig {
214213 URL : "https://github.com/ninech/doesnotexist.git" ,
215- SSHPrivateKeyFromFile : ptr . To (filenameRSAKey ),
214+ SSHPrivateKeyFromFile : new (filenameRSAKey ),
216215 },
217216 resourceCmd : resourceCmd {
218217 Wait : false ,
219218 Name : "ssh-key-auth-from-file" ,
220219 },
221- Size : ptr . To ("mini" ),
220+ Size : new ("mini "),
222221 SkipRepoAccessCheck : true ,
223222 },
224223 checkApp : func (t * testing.T , cmd applicationCmd , app * apps.Application ) {
@@ -236,13 +235,13 @@ func TestCreateApplication(t *testing.T) {
236235 cmd : applicationCmd {
237236 Git : gitConfig {
238237 URL : "https://github.com/ninech/doesnotexist.git" ,
239- SSHPrivateKeyFromFile : ptr . To (filenameED25519Key ),
238+ SSHPrivateKeyFromFile : new (filenameED25519Key ),
240239 },
241240 resourceCmd : resourceCmd {
242241 Wait : false ,
243242 Name : "ssh-key-auth-from-file-ed25519" ,
244243 },
245- Size : ptr . To ("mini" ),
244+ Size : new ("mini "),
246245 SkipRepoAccessCheck : true ,
247246 },
248247 checkApp : func (t * testing.T , cmd applicationCmd , app * apps.Application ) {
@@ -260,13 +259,13 @@ func TestCreateApplication(t *testing.T) {
260259 cmd : applicationCmd {
261260 Git : gitConfig {
262261 URL : "https://github.com/ninech/doesnotexist.git" ,
263- SSHPrivateKey : ptr . To ("not valid" ),
262+ SSHPrivateKey : new ("not valid "),
264263 },
265264 resourceCmd : resourceCmd {
266265 Wait : false ,
267266 Name : "ssh-key-auth-non-valid" ,
268267 },
269- Size : ptr . To ("mini" ),
268+ Size : new ("mini "),
270269 SkipRepoAccessCheck : true ,
271270 },
272271 errorExpected : true ,
@@ -280,7 +279,7 @@ func TestCreateApplication(t *testing.T) {
280279 Wait : false ,
281280 Name : "deploy-job-empty-command" ,
282281 },
283- Size : ptr . To ("mini" ),
282+ Size : new ("mini "),
284283 DeployJob : deployJob {Command : "" , Name : "print-date" , Retries : 2 , Timeout : time .Minute },
285284 SkipRepoAccessCheck : true ,
286285 },
@@ -298,7 +297,7 @@ func TestCreateApplication(t *testing.T) {
298297 Wait : false ,
299298 Name : "deploy-job-empty-name" ,
300299 },
301- Size : ptr . To ("mini" ),
300+ Size : new ("mini "),
302301 DeployJob : deployJob {Command : "date" , Name : "" , Retries : 2 , Timeout : time .Minute },
303302 SkipRepoAccessCheck : true ,
304303 },
@@ -318,7 +317,7 @@ func TestCreateApplication(t *testing.T) {
318317 Wait : false ,
319318 Name : "git-information-happy-path" ,
320319 },
321- Size : ptr . To ("mini" ),
320+ Size : new ("mini "),
322321 },
323322 gitInformationServiceResponse : test.GitInformationServiceResponse {
324323 Code : 200 ,
@@ -355,7 +354,7 @@ func TestCreateApplication(t *testing.T) {
355354 Wait : false ,
356355 Name : "git-information-errors" ,
357356 },
358- Size : ptr . To ("mini" ),
357+ Size : new ("mini "),
359358 },
360359 gitInformationServiceResponse : test.GitInformationServiceResponse {
361360 Code : 200 ,
@@ -376,7 +375,7 @@ func TestCreateApplication(t *testing.T) {
376375 Wait : false ,
377376 Name : "git-information-unknown-revision" ,
378377 },
379- Size : ptr . To ("mini" ),
378+ Size : new ("mini "),
380379 },
381380 gitInformationServiceResponse : test.GitInformationServiceResponse {
382381 Code : 200 ,
@@ -405,11 +404,11 @@ func TestCreateApplication(t *testing.T) {
405404 Wait : false ,
406405 Name : "git-information-unknown-revision" ,
407406 },
408- Size : ptr . To ("mini" ),
407+ Size : new ("mini "),
409408 },
410409 gitInformationServiceResponse : test.GitInformationServiceResponse {
411410 Code : 501 ,
412- Raw : ptr . To ("maintenance mode - we will be back soon" ),
411+ Raw : new ("maintenance mode - we will be back soon "),
413412 },
414413 errorExpected : true ,
415414 },
@@ -424,7 +423,7 @@ func TestCreateApplication(t *testing.T) {
424423 Wait : false ,
425424 Name : "git-information-update-url-to-https" ,
426425 },
427- Size : ptr . To ("mini" ),
426+ Size : new ("mini "),
428427 },
429428 gitInformationServiceResponse : test.GitInformationServiceResponse {
430429 Code : 200 ,
@@ -514,7 +513,7 @@ func TestApplicationWait(t *testing.T) {
514513 WaitTimeout : time .Second * 5 ,
515514 Name : "some-name" ,
516515 },
517- BasicAuth : ptr . To (true ),
516+ BasicAuth : new (true ),
518517 SkipRepoAccessCheck : true ,
519518 }
520519 project := test .DefaultProject
@@ -540,7 +539,7 @@ func TestApplicationWait(t *testing.T) {
540539 Spec : apps.ReleaseSpec {
541540 ForProvider : apps.ReleaseParameters {
542541 Configuration : apps.Config {
543- EnableBasicAuth : ptr . To (true ),
542+ EnableBasicAuth : new (true ),
544543 }.WithOrigin (apps .ConfigOriginApplication ),
545544 },
546545 },
0 commit comments