-
Notifications
You must be signed in to change notification settings - Fork 43
[6/n] [sled-agent] add remove_mupdate_override to OmicronSledConfig and friends #8097
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
base: sunshowers/spr/main.sled-agent-add-remove_mupdate_override-to-omicronsledconfig-and-friends
Are you sure you want to change the base?
Conversation
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
#[derive(Debug, Args)] | ||
struct SledSetPolicyArgs { | ||
/// id of the sled | ||
sled_id: SledUuid, | ||
|
||
/// The policy to set for the sled | ||
#[clap(value_enum)] | ||
policy: SledPolicyOpt, | ||
} | ||
|
||
#[derive(Clone, Copy, Debug, ValueEnum)] | ||
enum SledPolicyOpt { | ||
InService, | ||
NonProvisionable, | ||
Expunged, | ||
} | ||
|
||
impl fmt::Display for SledPolicyOpt { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
SledPolicyOpt::InService => write!(f, "in-service"), | ||
SledPolicyOpt::NonProvisionable => write!(f, "non-provisionable"), | ||
SledPolicyOpt::Expunged => write!(f, "expunged"), | ||
} | ||
} | ||
} | ||
|
||
impl From<SledPolicyOpt> for SledPolicy { | ||
fn from(value: SledPolicyOpt) -> Self { | ||
match value { | ||
SledPolicyOpt::InService => SledPolicy::InService { | ||
provision_policy: SledProvisionPolicy::Provisionable, | ||
}, | ||
SledPolicyOpt::NonProvisionable => SledPolicy::InService { | ||
provision_policy: SledProvisionPolicy::NonProvisionable, | ||
}, | ||
SledPolicyOpt::Expunged => SledPolicy::Expunged, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this but honestly didn't end up needing it -- left it in here because it seems somewhat useful.
> # Load example system with 7 sleds: | ||
> # | ||
> # sled 0: unset -> unset (unchanged) | ||
> # sled 1: unset -> set | ||
> # sled 2: set -> unset | ||
> # sled 3: set -> set (unchanged) | ||
> # sled 4: set -> set (changed) | ||
> # sled 5: set -> set (unchanged) but change something else | ||
> # sled 6: set -> sled removed | ||
> # | ||
> # We'll also add another sled below (new_sled_id) with | ||
> # remove_mupdate_override set. | ||
> # | ||
> # We don't need any zones for this test, so disable that to keep the | ||
> # outputs minimal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#8142 makes this much easier to read.
}, | ||
"remove_mupdate_override": null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there backcompat considerations here?
This adds:
In subsequent commits we'll make decisions based on this.
Depends on: