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

Add cvm flag to CLI and fields to coder-sdk #201

Merged
merged 4 commits into from
Dec 9, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
fixup! Add cvm flag to CLI and fields to coder-sdk
  • Loading branch information
cmoog committed Dec 8, 2020
commit 5041db93935ccb53143fada8c36afd76def0b141
8 changes: 5 additions & 3 deletions internal/cmd/envs.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ coder envs edit back-end-env --disk 20`,
image: img,
imageTag: tag,
orgName: org,
useCVM: useCVM,
notCVM: notCVM,
})
if err != nil {
return err
Expand Down Expand Up @@ -399,7 +401,7 @@ type updateConf struct {
imageTag string
orgName string
useCVM bool
noCVM bool
notCVM bool
}

func boolP(a bool) *bool { return &a }
Expand All @@ -412,13 +414,13 @@ func buildUpdateReq(ctx context.Context, client *coder.Client, conf updateConf)
defaultDiskGB int
)

if conf.useCVM && conf.noCVM {
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.noCVM {
if conf.notCVM {
updateReq.UseContainerVM = boolP(false)
}

Expand Down