Skip to content

HostPhase2Status could use an enum when boot disk is unknown #10504

@karencfv

Description

@karencfv

To decide whether a sled is missing from inventory, we use the following method:

impl SledAgentUpdateStatus {
    /// Update status suitable for a given sled ID that isn't present in
    /// inventory.
    pub fn unknown(sled_id: SledUuid) -> Self {
        Self {
            sled_id,
            zones: IdOrdMap::new(),
            host_phase_2: HostPhase2Status {
                boot_disk: Err("unknown".to_string()),
                slot_a_version: TufRepoVersion::Unknown,
                slot_b_version: TufRepoVersion::Unknown,
            },
        }
    }
}

How we check the boot disk is a bit fragile due to string equality. It would be nice to return an enum variant.

Found in #10476 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions