@@ -173,14 +173,11 @@ coder envs create --cpu 4 --disk 100 --memory 8 --image 5f443b16-30652892427b955
173
173
return xerrors .New ("org is required for multi-org members" )
174
174
}
175
175
176
- importedImg , err := findImg (ctx ,
177
- findImgConf {
178
- client : client ,
179
- email : * user ,
180
- imgName : img ,
181
- orgName : org ,
182
- },
183
- )
176
+ importedImg , err := findImg (ctx , client , findImgConf {
177
+ email : * user ,
178
+ imgName : img ,
179
+ orgName : org ,
180
+ })
184
181
if err != nil {
185
182
return err
186
183
}
@@ -225,7 +222,7 @@ coder envs create --cpu 4 --disk 100 --memory 8 --image 5f443b16-30652892427b955
225
222
226
223
clog .LogSuccess ("creating environment..." ,
227
224
clog .BlankLine ,
228
- clog .Tipf (`run "coder envs watch-build %q " to trail the build logs` , env .Name ),
225
+ clog .Tipf (`run "coder envs watch-build %s " to trail the build logs` , env .Name ),
229
226
)
230
227
return nil
231
228
},
@@ -292,20 +289,17 @@ coder envs edit back-end-env --disk 20`,
292
289
diskGB , _ = cmd .Flags ().GetInt ("disk" )
293
290
gpus , _ = cmd .Flags ().GetInt ("gpus" )
294
291
295
- req , err := buildUpdateReq (ctx ,
296
- updateConf {
297
- cpu : cpuCores ,
298
- memGB : memGB ,
299
- diskGB : diskGB ,
300
- gpus : gpus ,
301
- client : client ,
302
- environment : env ,
303
- user : user ,
304
- image : img ,
305
- imageTag : tag ,
306
- orgName : org ,
307
- },
308
- )
292
+ req , err := buildUpdateReq (ctx , client , updateConf {
293
+ cpu : cpuCores ,
294
+ memGB : memGB ,
295
+ diskGB : diskGB ,
296
+ gpus : gpus ,
297
+ environment : env ,
298
+ user : user ,
299
+ image : img ,
300
+ imageTag : tag ,
301
+ orgName : org ,
302
+ })
309
303
if err != nil {
310
304
return err
311
305
}
@@ -324,7 +318,7 @@ coder envs edit back-end-env --disk 20`,
324
318
325
319
clog .LogSuccess ("applied changes to the environment, rebuilding..." ,
326
320
clog .BlankLine ,
327
- clog .Tipf (`run "coder envs watch-build %q " to trail the build logs` , envName ),
321
+ clog .Tipf (`run "coder envs watch-build %s " to trail the build logs` , envName ),
328
322
)
329
323
return nil
330
324
},
@@ -359,7 +353,7 @@ func rmEnvsCmd(user *string) *cobra.Command {
359
353
}
360
354
if _ , err := confirm .Run (); err != nil {
361
355
return clog .Fatal (
362
- "failed to confirm prompt " , clog .BlankLine ,
356
+ "failed to confirm deletion " , clog .BlankLine ,
363
357
clog .Tipf (`use "--force" to rebuild without a confirmation prompt` ),
364
358
)
365
359
}
@@ -395,15 +389,14 @@ type updateConf struct {
395
389
memGB float32
396
390
diskGB int
397
391
gpus int
398
- client * coder.Client
399
392
environment * coder.Environment
400
393
user * string
401
394
image string
402
395
imageTag string
403
396
orgName string
404
397
}
405
398
406
- func buildUpdateReq (ctx context.Context , conf updateConf ) (* coder.UpdateEnvironmentReq , error ) {
399
+ func buildUpdateReq (ctx context.Context , client * coder. Client , conf updateConf ) (* coder.UpdateEnvironmentReq , error ) {
407
400
var (
408
401
updateReq coder.UpdateEnvironmentReq
409
402
defaultCPUCores float32
@@ -413,14 +406,11 @@ func buildUpdateReq(ctx context.Context, conf updateConf) (*coder.UpdateEnvironm
413
406
414
407
// If this is not empty it means the user is requesting to change the environment image.
415
408
if conf .image != "" {
416
- importedImg , err := findImg (ctx ,
417
- findImgConf {
418
- client : conf .client ,
419
- email : * conf .user ,
420
- imgName : conf .image ,
421
- orgName : conf .orgName ,
422
- },
423
- )
409
+ importedImg , err := findImg (ctx , client , findImgConf {
410
+ email : * conf .user ,
411
+ imgName : conf .image ,
412
+ orgName : conf .orgName ,
413
+ })
424
414
if err != nil {
425
415
return nil , err
426
416
}
0 commit comments