Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confirm oxide to rancher machine states are correct #5

Open
briandowns opened this issue Dec 4, 2024 · 0 comments
Open

confirm oxide to rancher machine states are correct #5

briandowns opened this issue Dec 4, 2024 · 0 comments

Comments

@briandowns
Copy link
Contributor

briandowns commented Dec 4, 2024

Audit the toRancherMachineState function to ensure Oxide instance states are mapped to the semantically correct Rancher machine states. For example, should oxide.InstanceStateRebooting map to state.Stopping or state.Starting? What's the behavior difference between Rancher machine states?

// toRancherMachineState converts an Oxide instance state to a Rancher machine
// state.
func toRancherMachineState(instanceState oxide.InstanceState) state.State {
switch instanceState {
case oxide.InstanceStateCreating, oxide.InstanceStateStarting:
return state.Starting
case oxide.InstanceStateRunning, oxide.InstanceStateMigrating:
return state.Running
case oxide.InstanceStateStopping, oxide.InstanceStateRebooting:
return state.Stopping
case oxide.InstanceStateStopped, oxide.InstanceStateRepairing:
return state.Stopped
case oxide.InstanceStateFailed, oxide.InstanceStateDestroyed:
return state.Error
default:
return state.None
}
}

@sudomateo sudomateo changed the title Confirm Oxide to Rancher State Mappings are Correct confirm oxide to rancher machine states are correct Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant