diff --git a/coder-sdk/env.go b/coder-sdk/env.go index 9ef54f11..d28e6fb7 100644 --- a/coder-sdk/env.go +++ b/coder-sdk/env.go @@ -74,17 +74,16 @@ const ( // CreateEnvironmentRequest is used to configure a new environment. type CreateEnvironmentRequest struct { - Name string `json:"name"` - ImageID string `json:"image_id"` - OrgID string `json:"org_id"` - ImageTag string `json:"image_tag"` - CPUCores float32 `json:"cpu_cores"` - MemoryGB float32 `json:"memory_gb"` - DiskGB int `json:"disk_gb"` - GPUs int `json:"gpus"` - Services []string `json:"services"` - UseContainerVM bool `json:"use_container_vm"` - EnableAutoStart bool `json:"autostart_enabled"` + Name string `json:"name"` + ImageID string `json:"image_id"` + OrgID string `json:"org_id"` + ImageTag string `json:"image_tag"` + CPUCores float32 `json:"cpu_cores"` + MemoryGB float32 `json:"memory_gb"` + DiskGB int `json:"disk_gb"` + GPUs int `json:"gpus"` + Services []string `json:"services"` + UseContainerVM bool `json:"use_container_vm"` } // CreateEnvironment sends a request to create an environment. diff --git a/docs/coder_envs_create.md b/docs/coder_envs_create.md index ea23ff94..d728e34b 100644 --- a/docs/coder_envs_create.md +++ b/docs/coder_envs_create.md @@ -24,7 +24,6 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub --container-based-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. - --enable-autostart automatically start this environment at your preferred time. --follow follow buildlog after initiating rebuild -g, --gpus int number GPUs an environment should be provisioned with. -h, --help help for create diff --git a/internal/cmd/envs.go b/internal/cmd/envs.go index db755509..ae14b528 100644 --- a/internal/cmd/envs.go +++ b/internal/cmd/envs.go @@ -11,7 +11,6 @@ import ( "os" "cdr.dev/coder-cli/coder-sdk" - "cdr.dev/coder-cli/internal/config" "cdr.dev/coder-cli/internal/x/xcobra" "cdr.dev/coder-cli/pkg/clog" "cdr.dev/coder-cli/pkg/tablewriter" @@ -152,16 +151,15 @@ coder envs --user charlie@coder.com ls -o json \ func createEnvCmd() *cobra.Command { var ( - org string - cpu float32 - memory float32 - disk int - gpus int - img string - tag string - follow bool - useCVM bool - enableAutostart bool + org string + cpu float32 + memory float32 + disk int + gpus int + img string + tag string + follow bool + useCVM bool ) cmd := &cobra.Command{ @@ -172,9 +170,6 @@ func createEnvCmd() *cobra.Command { Example: `# create a new environment using default resource amounts coder envs create my-new-env --image ubuntu coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ubuntu`, - PreRun: func(cmd *cobra.Command, args []string) { - autoStartInfo() - }, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() if img == "" { @@ -205,16 +200,15 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub // ExactArgs(1) ensures our name value can't panic on an out of bounds. createReq := &coder.CreateEnvironmentRequest{ - Name: args[0], - ImageID: importedImg.ID, - OrgID: importedImg.OrganizationID, - ImageTag: tag, - CPUCores: cpu, - MemoryGB: memory, - DiskGB: disk, - GPUs: gpus, - UseContainerVM: useCVM, - EnableAutoStart: enableAutostart, + Name: args[0], + ImageID: importedImg.ID, + OrgID: importedImg.OrganizationID, + ImageTag: tag, + CPUCores: cpu, + MemoryGB: memory, + DiskGB: disk, + GPUs: gpus, + UseContainerVM: useCVM, } // if any of these defaulted to their zero value we provision @@ -258,7 +252,6 @@ coder envs create my-new-powerful-env --cpu 12 --disk 100 --memory 16 --image ub 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-based-vm", false, "deploy the environment as a Container-based VM") - cmd.Flags().BoolVar(&enableAutostart, "enable-autostart", false, "automatically start this environment at your preferred time.") _ = cmd.MarkFlagRequired("image") return cmd } @@ -391,9 +384,6 @@ func editEnvCmd() *cobra.Command { Example: `coder envs edit back-end-env --cpu 4 coder envs edit back-end-env --disk 20`, - PreRun: func(cmd *cobra.Command, args []string) { - autoStartInfo() - }, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() client, err := newClient(ctx) @@ -621,18 +611,3 @@ func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf) } return &updateReq, nil } - -// TODO (Grey): Remove education in a future non-patch release. -func autoStartInfo() { - var preferencesURI string - - accessURI, err := config.URL.Read() - if err != nil { - // Error is fairly benign in this case, fallback to relative URI - preferencesURI = "/preferences" - } else { - preferencesURI = fmt.Sprintf("%s%s", accessURI, "/preferences?tab=autostart") - } - - clog.LogInfo("⚡NEW: Automate daily environment startup", "Visit "+preferencesURI+" to configure your preferred time") -} diff --git a/internal/cmd/rebuild.go b/internal/cmd/rebuild.go index 7b39d39d..1eff6e08 100644 --- a/internal/cmd/rebuild.go +++ b/internal/cmd/rebuild.go @@ -29,9 +29,6 @@ func rebuildEnvCommand() *cobra.Command { Args: xcobra.ExactArgs(1), Example: `coder envs rebuild front-end-env --follow coder envs rebuild backend-env --force`, - PreRun: func(cmd *cobra.Command, args []string) { - autoStartInfo() - }, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() client, err := newClient(ctx)