You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// If any of the flags have defaulted to zero-values, it implies the user does not wish to change that value.
// With that said, we can enforce this by reassigning the request field to the corresponding existing environment value.
if cpuCores == 0 {
updateReq.CPUCores = &env.CPUCores
} else {
updateReq.CPUCores = &cpuCores
}
if memGB == 0 {
updateReq.MemoryGB = &env.MemoryGB
} else {
updateReq.MemoryGB = &memGB
}
if diskGB == 0 {
updateReq.DiskGB = &env.DiskGB
} else {
updateReq.DiskGB = &diskGB
}
if gpus == 0 {
updateReq.GPUs = &env.GPUs
} else {
updateReq.GPUs = &gpus
}
if img == "" {
updateReq.ImageID = &env.ImageID
} else {
updateReq.ImageID = &img
}
if tag == "" {
updateReq.ImageTag = &env.ImageTag
} else {
updateReq.ImageTag = &tag
}
if err := client.EditEnvironment(cmd.Context(), env.ID, updateReq); err != nil {
return xerrors.Errorf("failed to apply changes to environment: '%s'", envName)
}
clog.LogSuccess(
"applied changes to the environment, rebuilding...",
clog.BlankLine,
clog.Tip(`run "coder envs watch-build %q" to trail the build logs`, envName),
)
return nil
},
}
cmd.Flags().StringVarP(&img, "image", "i", "", "image ID of the image you wan't the environment to be based off of.")
cmd.Flags().StringVarP(&tag, "tag", "t", "latest", "image tag of the image you wan't to base the environment off of.")
cmd.Flags().Float32P("cpu", "c", cpuCores, "The number of cpu cores the environment should be provisioned with.")
cmd.Flags().Float32P("memory", "m", memGB, "The amount of RAM an environment should be provisioned with.")
cmd.Flags().IntP("disk", "d", diskGB, "The amount of disk storage an environment should be provisioned with.")
cmd.Flags().IntP("gpu", "g", gpus, "The amount of disk storage to provision the environment with.")
cmd.Flags().BoolVar(&follow, "follow", false, "follow buildlog after initiating rebuild")
return cmd
}
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.