Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Remove cvm edit flag#204

Merged
cmoog merged 3 commits intomasterfromremove-cvm-edit-flag
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletioncoder-sdk/env.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -132,7 +132,6 @@ type UpdateEnvironmentReq struct {
GPUs *int `json:"gpus"`
Services *[]string `json:"services"`
CodeServerReleaseURL *string `json:"code_server_release_url"`
UseContainerVM *bool `json:"use_container_vm"`
}

// RebuildEnvironment requests that the given envID is rebuilt with no changes to its specification.
Expand Down
20 changes: 10 additions & 10 deletionsdocs/coder_envs_create.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,16 +21,16 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
### Options

```
--container-vm deploy the environment as a Container-based VM
-c, --cpu float32 number of cpu cores the environment should be provisioned with.
-d, --disk int GB of disk storage an environment should be provisioned with.
--follow follow buildlog after initiating rebuild
-g, --gpus int number GPUs an environment should be provisioned with.
-h, --help help for create
-i, --image string name of the image to base the environment off of.
-m, --memory float32 GB of RAM an environment should be provisioned with.
-o, --org string name of the organization the environment should be created under.
-t, --tag string tag of the image the environment will be based off of. (default "latest")
--container-based-vm deploy the environment as a Container-based VM
-c, --cpu float32number of cpu cores the environment should be provisioned with.
-d, --disk intGB of disk storage an environment should be provisioned with.
--followfollow buildlog after initiating rebuild
-g, --gpus intnumber GPUs an environment should be provisioned with.
-h, --helphelp for create
-i, --image stringname of the image to base the environment off of.
-m, --memory float32GB of RAM an environment should be provisioned with.
-o, --org stringname of the organization the environment should be created under.
-t, --tag stringtag of the image the environment will be based off of. (default "latest")
```

### Options inherited from parent commands
Expand Down
22 changes: 10 additions & 12 deletionsdocs/coder_envs_edit.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,18 +21,16 @@ coder envs edit back-end-env --disk 20
### Options

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

### Options inherited from parent commands
Expand Down
22 changes: 1 addition & 21 deletionsinternal/cmd/envs.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -245,7 +245,7 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub
cmd.Flags().IntVarP(&gpus, "gpus", "g", 0, "number GPUs an environment should be provisioned with.")
cmd.Flags().StringVarP(&img, "image", "i", "", "name of the image to base the environment off of.")
cmd.Flags().BoolVar(&follow, "follow", false, "follow buildlog after initiating rebuild")
cmd.Flags().BoolVar(&useCVM, "container-vm", false, "deploy the environment as a Container-based VM")
cmd.Flags().BoolVar(&useCVM, "container-based-vm", false, "deploy the environment as a Container-based VM")
_ = cmd.MarkFlagRequired("image")
return cmd
}
Expand All@@ -260,8 +260,6 @@ func editEnvCmd() *cobra.Command {
disk int
gpus int
follow bool
useCVM bool
notCVM bool
user string
)

Expand DownExpand Up@@ -307,8 +305,6 @@ coder envs edit back-end-env --disk 20`,
image: img,
imageTag: tag,
orgName: org,
useCVM: useCVM,
notCVM: notCVM,
})
if err != nil {
return err
Expand DownExpand Up@@ -341,8 +337,6 @@ coder envs edit back-end-env --disk 20`,
cmd.Flags().IntVarP(&disk, "disk", "d", 0, "The amount of disk storage an environment should be provisioned with.")
cmd.Flags().IntVarP(&gpus, "gpu", "g", 0, "The amount of disk storage to provision the environment with.")
cmd.Flags().BoolVar(&follow, "follow", false, "follow buildlog after initiating rebuild")
cmd.Flags().BoolVar(&useCVM, "container-vm", false, "deploy the environment as a Container-based VM")
cmd.Flags().BoolVar(&notCVM, "not-container-vm", false, "do not deploy the environment as a Container-based VM")
cmd.Flags().StringVar(&user, "user", coder.Me, "Specify the user whose resources to target")
return cmd
}
Expand DownExpand Up@@ -412,12 +406,8 @@ type updateConf struct {
image string
imageTag string
orgName string
useCVM bool
notCVM bool
}

func boolP(a bool) *bool { return &a }

func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf) (*coder.UpdateEnvironmentReq, error) {
var (
updateReq coder.UpdateEnvironmentReq
Expand All@@ -426,16 +416,6 @@ func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf)
defaultDiskGB int
)

if conf.useCVM && conf.notCVM {
return nil, xerrors.New("--container-vm and --not-container-vm flags conflict")
}
if conf.useCVM {
updateReq.UseContainerVM = boolP(true)
}
if conf.notCVM {
updateReq.UseContainerVM = boolP(false)
}

// If this is not empty it means the user is requesting to change the environment image.
if conf.image != "" {
importedImg, err := findImg(ctx, client, findImgConf{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp