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

Commit c25b0e9

Browse files
authored
Remove cvm edit flag (#204)
1 parent 68114e3 commit c25b0e9

File tree

4 files changed

+21
-44
lines changed

4 files changed

+21
-44
lines changed

coder-sdk/env.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ type UpdateEnvironmentReq struct {
132132
GPUs *int `json:"gpus"`
133133
Services *[]string `json:"services"`
134134
CodeServerReleaseURL *string `json:"code_server_release_url"`
135-
UseContainerVM *bool `json:"use_container_vm"`
136135
}
137136

138137
// RebuildEnvironment requests that the given envID is rebuilt with no changes to its specification.

docs/coder_envs_create.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
2121
### Options
2222

2323
```
24-
--container-vm deploy the environment as a Container-based VM
25-
-c, --cpu float32 number of cpu cores the environment should be provisioned with.
26-
-d, --disk int GB of disk storage an environment should be provisioned with.
27-
--follow follow buildlog after initiating rebuild
28-
-g, --gpus int number GPUs an environment should be provisioned with.
29-
-h, --help help for create
30-
-i, --image string name of the image to base the environment off of.
31-
-m, --memory float32 GB of RAM an environment should be provisioned with.
32-
-o, --org string name of the organization the environment should be created under.
33-
-t, --tag string tag of the image the environment will be based off of. (default "latest")
24+
--container-based-vm deploy the environment as a Container-based VM
25+
-c, --cpu float32 number of cpu cores the environment should be provisioned with.
26+
-d, --disk int GB of disk storage an environment should be provisioned with.
27+
--follow follow buildlog after initiating rebuild
28+
-g, --gpus int number GPUs an environment should be provisioned with.
29+
-h, --help help for create
30+
-i, --image string name of the image to base the environment off of.
31+
-m, --memory float32 GB of RAM an environment should be provisioned with.
32+
-o, --org string name of the organization the environment should be created under.
33+
-t, --tag string tag of the image the environment will be based off of. (default "latest")
3434
```
3535

3636
### Options inherited from parent commands

docs/coder_envs_edit.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,16 @@ coder envs edit back-end-env --disk 20
2121
### Options
2222

2323
```
24-
--container-vm deploy the environment as a Container-based VM
25-
-c, --cpu float32 The number of cpu cores the environment should be provisioned with.
26-
-d, --disk int The amount of disk storage an environment should be provisioned with.
27-
--follow follow buildlog after initiating rebuild
28-
-g, --gpu int The amount of disk storage to provision the environment with.
29-
-h, --help help for edit
30-
-i, --image string name of the image you want the environment to be based off of.
31-
-m, --memory float32 The amount of RAM an environment should be provisioned with.
32-
--not-container-vm do not deploy the environment as a Container-based VM
33-
-o, --org string name of the organization the environment should be created under.
34-
-t, --tag string image tag of the image you want to base the environment off of. (default "latest")
35-
--user string Specify the user whose resources to target (default "me")
24+
-c, --cpu float32 The number of cpu cores the environment should be provisioned with.
25+
-d, --disk int The amount of disk storage an environment should be provisioned with.
26+
--follow follow buildlog after initiating rebuild
27+
-g, --gpu int The amount of disk storage to provision the environment with.
28+
-h, --help help for edit
29+
-i, --image string name of the image you want the environment to be based off of.
30+
-m, --memory float32 The amount of RAM an environment should be provisioned with.
31+
-o, --org string name of the organization the environment should be created under.
32+
-t, --tag string image tag of the image you want to base the environment off of. (default "latest")
33+
--user string Specify the user whose resources to target (default "me")
3634
```
3735

3836
### Options inherited from parent commands

internal/cmd/envs.go

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
245245
cmd.Flags().IntVarP(&gpus, "gpus", "g", 0, "number GPUs an environment should be provisioned with.")
246246
cmd.Flags().StringVarP(&img, "image", "i", "", "name of the image to base the environment off of.")
247247
cmd.Flags().BoolVar(&follow, "follow", false, "follow buildlog after initiating rebuild")
248-
cmd.Flags().BoolVar(&useCVM, "container-vm", false, "deploy the environment as a Container-based VM")
248+
cmd.Flags().BoolVar(&useCVM, "container-based-vm", false, "deploy the environment as a Container-based VM")
249249
_ = cmd.MarkFlagRequired("image")
250250
return cmd
251251
}
@@ -260,8 +260,6 @@ func editEnvCmd() *cobra.Command {
260260
disk int
261261
gpus int
262262
follow bool
263-
useCVM bool
264-
notCVM bool
265263
user string
266264
)
267265

@@ -307,8 +305,6 @@ coder envs edit back-end-env --disk 20`,
307305
image: img,
308306
imageTag: tag,
309307
orgName: org,
310-
useCVM: useCVM,
311-
notCVM: notCVM,
312308
})
313309
if err != nil {
314310
return err
@@ -341,8 +337,6 @@ coder envs edit back-end-env --disk 20`,
341337
cmd.Flags().IntVarP(&disk, "disk", "d", 0, "The amount of disk storage an environment should be provisioned with.")
342338
cmd.Flags().IntVarP(&gpus, "gpu", "g", 0, "The amount of disk storage to provision the environment with.")
343339
cmd.Flags().BoolVar(&follow, "follow", false, "follow buildlog after initiating rebuild")
344-
cmd.Flags().BoolVar(&useCVM, "container-vm", false, "deploy the environment as a Container-based VM")
345-
cmd.Flags().BoolVar(&notCVM, "not-container-vm", false, "do not deploy the environment as a Container-based VM")
346340
cmd.Flags().StringVar(&user, "user", coder.Me, "Specify the user whose resources to target")
347341
return cmd
348342
}
@@ -412,12 +406,8 @@ type updateConf struct {
412406
image string
413407
imageTag string
414408
orgName string
415-
useCVM bool
416-
notCVM bool
417409
}
418410

419-
func boolP(a bool) *bool { return &a }
420-
421411
func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf) (*coder.UpdateEnvironmentReq, error) {
422412
var (
423413
updateReq coder.UpdateEnvironmentReq
@@ -426,16 +416,6 @@ func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf)
426416
defaultDiskGB int
427417
)
428418

429-
if conf.useCVM && conf.notCVM {
430-
return nil, xerrors.New("--container-vm and --not-container-vm flags conflict")
431-
}
432-
if conf.useCVM {
433-
updateReq.UseContainerVM = boolP(true)
434-
}
435-
if conf.notCVM {
436-
updateReq.UseContainerVM = boolP(false)
437-
}
438-
439419
// If this is not empty it means the user is requesting to change the environment image.
440420
if conf.image != "" {
441421
importedImg, err := findImg(ctx, client, findImgConf{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy