Skip to content

[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

Open
wants to merge 5 commits into
base: sunshowers/spr/main.sled-agent-add-remove_mupdate_override-to-omicronsledconfig-and-friends
Choose a base branch
from

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented May 6, 2025

This adds:

  • data types
  • db storage
  • blueprint display
  • blueprint diff display
  • generation bump if there's a change to this field
  • reconfigurator-cli tests for display and generation bump
  • reconfigurator-cli support code including a couple of debug commands

In subsequent commits we'll make decisions based on this.

Depends on:

Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the title [sled-agent] add remove_mupdate_override to OmicronSledConfig and friends [6/n] [sled-agent] add remove_mupdate_override to OmicronSledConfig and friends May 6, 2025
sunshowers added 3 commits May 6, 2025 09:17
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Comment on lines +333 to +372
#[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,
}
}
}
Copy link
Contributor Author

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.

Created using spr 1.3.6-beta.1
Comment on lines +2 to +16
> # 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.
Copy link
Contributor Author

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.

Comment on lines +812 to +813
},
"remove_mupdate_override": null
Copy link
Contributor Author

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?

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

Successfully merging this pull request may close these issues.

1 participant