File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -584,7 +584,23 @@ export const handlers = makeHandlers({
584584
585585 return json ( newInstance , { status : 201 } )
586586 } ,
587- instanceView : ( { path, query } ) => lookup . instance ( { ...path , ...query } ) ,
587+ instanceView : ( { path, query } ) => {
588+ const instance = lookup . instance ( { ...path , ...query } )
589+
590+ // if empty uses default auto-restart behaviour
591+ // if set, is based off of the policy
592+ // https://github.com/oxidecomputer/omicron/blob/f63ed095e744fb8d2383fda6799eb0b2d6dfbd3c/nexus/db-queries/src/db/datastore/instance.rs#L228C26-L239
593+ if ( instance . auto_restart_policy === 'never' ) {
594+ instance . auto_restart_enabled = false
595+ } else if (
596+ instance . auto_restart_policy === 'best_effort' ||
597+ ! instance . auto_restart_policy // included for posterity but this has to be set in the mock data anyway
598+ ) {
599+ instance . auto_restart_enabled = true
600+ }
601+
602+ return instance
603+ } ,
588604 instanceUpdate ( { path, query, body } ) {
589605 const instance = lookup . instance ( { ...path , ...query } )
590606
You can’t perform that action at this time.
0 commit comments