Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 52aea4c

Browse files
author
Faris Huskovic
committed
fix build
1 parent 40f521c commit 52aea4c

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

ci/integration/envs_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ func TestEnvsCLI(t *testing.T) {
4747
// )
4848

4949
// Invalid environment name should fail.
50-
c.Run(ctx, "coder envs create --image "+ubuntuImgID+" this-IS-an-invalid-EnvironmentName").Assert(t,
50+
c.Run(ctx, "coder envs create --org Coder --image "+ubuntuImgID+" this-IS-an-invalid-EnvironmentName").Assert(t,
5151
tcli.Error(),
52-
tcli.StderrMatches(regexp.QuoteMeta("fatal: image not found - did you forget to import this image?\n\n")),
52+
tcli.StderrMatches(regexp.QuoteMeta("fatal: image not found - did you forget to import this image?")),
5353
)
5454

5555
// TODO(Faris) : uncomment this when we can safely purge the environments
@@ -61,9 +61,9 @@ func TestEnvsCLI(t *testing.T) {
6161
// )
6262

6363
// Image does not exist should fail.
64-
c.Run(ctx, "coder envs create --image does-not-exist env-will-not-be-created").Assert(t,
64+
c.Run(ctx, "coder envs create --org Coder --image does-not-exist env-will-not-be-created").Assert(t,
6565
tcli.Error(),
66-
tcli.StderrMatches(regexp.QuoteMeta("fatal: image not found - did you forget to import this image?\n\n")),
66+
tcli.StderrMatches(regexp.QuoteMeta("fatal: image not found - did you forget to import this image?")),
6767
)
6868
})
6969
}

internal/cmd/ceapi.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func findImg(ctx context.Context, client *coder.Client, email, imgName, orgName
113113
}
114114

115115
if len(possibleMatches) == 0 {
116-
return nil, xerrors.New("image not found")
116+
return nil, xerrors.New("image not found - did you forget to import this image?")
117117
}
118118

119119
lines := []string{clog.Tipf("Did you mean?")}
@@ -127,7 +127,6 @@ func findImg(ctx context.Context, client *coder.Client, email, imgName, orgName
127127
)
128128
}
129129

130-
131130
func getImgs(ctx context.Context, client *coder.Client, email, orgName string) ([]coder.Image, error) {
132131
u, err := client.UserByEmail(ctx, email)
133132
if err != nil {

internal/cmd/envs.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ coder envs create --cpu 4 --disk 100 --memory 8 --image 5f443b16-30652892427b955
237237

238238
multiOrgMember, err := isMultiOrgMember(*user)
239239
if err != nil {
240-
clog.Fatal(fmt.Sprintf("checking if user is mutli-org member: %s", err.Error()))
240+
_ = clog.Fatal(fmt.Sprintf("checking if user is mutli-org member: %s", err.Error()))
241241
}
242242

243243
// if the user belongs to multiple organizations we need them to specify which one.
@@ -249,7 +249,7 @@ coder envs create --cpu 4 --disk 100 --memory 8 --image 5f443b16-30652892427b955
249249

250250
func editEnvCommand(user *string) *cobra.Command {
251251
var (
252-
org string
252+
org string
253253
img string
254254
tag string
255255
cpuCores float32
@@ -288,16 +288,16 @@ coder envs edit back-end-env --disk 20`,
288288

289289
req, err := buildUpdateReq(cmd.Context(),
290290
updateConf{
291-
cpu: cpuCores,
292-
memGB: memGB,
293-
diskGB: diskGB,
294-
gpus: gpus,
291+
cpu: cpuCores,
292+
memGB: memGB,
293+
diskGB: diskGB,
294+
gpus: gpus,
295295
client: client,
296296
environment: env,
297297
user: user,
298298
image: img,
299299
imageTag: tag,
300-
orgName: org,
300+
orgName: org,
301301
},
302302
)
303303
if err != nil {
@@ -335,9 +335,9 @@ coder envs edit back-end-env --disk 20`,
335335
if img != "" {
336336
multiOrgMember, err := isMultiOrgMember(*user)
337337
if err != nil {
338-
clog.Fatal(fmt.Sprintf("checking if user is mutli-org member: %s", err.Error()))
338+
_ = clog.Fatal(fmt.Sprintf("checking if user is mutli-org member: %s", err.Error()))
339339
}
340-
340+
341341
// if the user belongs to multiple organizations we need them to specify which one.
342342
if *multiOrgMember {
343343
_ = cmd.MarkFlagRequired("org")
@@ -405,16 +405,16 @@ func rmEnvsCommand(user *string) *cobra.Command {
405405
}
406406

407407
type updateConf struct {
408-
cpu float32
409-
memGB float32
410-
diskGB int
411-
gpus int
408+
cpu float32
409+
memGB float32
410+
diskGB int
411+
gpus int
412412
client *coder.Client
413413
environment *coder.Environment
414414
user *string
415415
image string
416416
imageTag string
417-
orgName string
417+
orgName string
418418
}
419419

420420
func buildUpdateReq(ctx context.Context, conf updateConf) (*coder.UpdateEnvironmentReq, error) {

0 commit comments

Comments
 (0)