Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion OMICRON_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1ee118395ed95450274fdde79f322b84c00e252e
af4a78e9cfcfeda9cf99156744c0efb913a9c1f8
32 changes: 29 additions & 3 deletions app/api/__generated__/Api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/api/__generated__/OMICRON_VERSION

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions app/api/__generated__/validate.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions app/pages/project/instances/AutoRestartCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@ export function AutoRestartCard() {
path: { instance: instanceSelector.instance },
query: { project: instanceSelector.project },
body: {
ncpus: instance.ncpus,
memory: instance.memory,
bootDisk: instance.bootDiskId,
autoRestartPolicy: match(values.autoRestartPolicy)
.with('default', () => undefined)
.with('default', () => null)
.with('never', () => 'never' as const)
.with('best_effort', () => 'best_effort' as const)
.exhaustive(),
ncpus: instance.ncpus,
memory: instance.memory,
cpuPlatform: instance.cpuPlatform || null,
bootDisk: instance.bootDiskId || null,
},
})
})
Expand Down
8 changes: 7 additions & 1 deletion app/pages/project/instances/InstancePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,13 @@ export function ResizeInstanceModal({
instanceUpdate.mutate({
path: { instance: instance.name },
query: { project },
body: { ncpus, memory: memory * GiB, bootDisk: instance.bootDiskId },
body: {
ncpus,
memory: memory * GiB,
bootDisk: instance.bootDiskId || null,
cpuPlatform: instance.cpuPlatform || null,
autoRestartPolicy: instance.autoRestartPolicy || null,
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure the fact that this was missing autoRestartPolicy was a bug.

})
})
const formId = useId()
Expand Down
12 changes: 7 additions & 5 deletions app/pages/project/instances/StorageTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ export default function StorageTab() {
instanceUpdate({
path: { instance: instance.id },
body: {
bootDisk: undefined,
bootDisk: null,
ncpus: instance.ncpus,
memory: instance.memory,
// this would get unset if we left it out
autoRestartPolicy: instance.autoRestartPolicy,
autoRestartPolicy: instance.autoRestartPolicy || null,
cpuPlatform: instance.cpuPlatform || null,
},
}),
errorTitle: 'Could not unset boot disk',
Expand Down Expand Up @@ -205,6 +205,7 @@ export default function StorageTab() {
instance.autoRestartPolicy,
instance.ncpus,
instance.memory,
instance.cpuPlatform,
getSnapshotAction,
]
)
Expand All @@ -231,8 +232,8 @@ export default function StorageTab() {
bootDisk: disk.id,
ncpus: instance.ncpus,
memory: instance.memory,
// this would get unset if we left it out
autoRestartPolicy: instance.autoRestartPolicy,
autoRestartPolicy: instance.autoRestartPolicy || null,
cpuPlatform: instance.cpuPlatform || null,
},
}),
errorTitle: `Could not ${verb} boot disk`,
Expand Down Expand Up @@ -283,6 +284,7 @@ export default function StorageTab() {
instance.autoRestartPolicy,
instance.ncpus,
instance.memory,
instance.cpuPlatform,
getSnapshotAction,
bootDisks,
]
Expand Down
4 changes: 2 additions & 2 deletions mock-api/msw/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ export const handlers = makeHandlers({

// AUTO RESTART

// Undefined or missing is meaningful: it unsets the value
// null is meaningful: it unsets the value
instance.auto_restart_policy = body.auto_restart_policy
instance.cpu_platform = body.cpu_platform

// We depart here from nexus in that nexus does both of the following
// calculations at view time (when converting model to view). We can't
Expand All @@ -651,7 +652,6 @@ export const handlers = makeHandlers({

// https://github.com/oxidecomputer/omicron/blob/0c6ab099e/nexus/db-queries/src/db/datastore/instance.rs#L228-L239
instance.auto_restart_enabled = match(instance.auto_restart_policy)
.with(undefined, () => true)
.with(null, () => true)
.with('best_effort', () => true)
.with('never', () => false)
Expand Down
Loading