Skip to content

Be more consistent with ZoneKind -> string methods #8510

@jgallagher

Description

@jgallagher

ZoneKind currently has five different methods converting &self to &'static str, each of which is slightly different and is used in different contexts. This is confusing at best. Some examples of differences:

  • zone_prefix uses underscores. These strings are used by sled-agent both to name zones and to find the {zone_prefix}.tar.gz filenames in the install dataset.
  • service_prefix is almost the same, except crucible pantry is crucible/pantry instead of crucible_pantry (presumably due to SMF namespace organization?)
  • name_prefix is zone_prefix with all the underscores swapped to dashes
  • report_str is zone_prefix except it has separate boundary_ntp and internal_ntp values, instead of using ntp for both
  • artifact_name matches the ArtifactId::name values from the unpacked composite control plane artifact in a TUF repo. These come from the oxide.json's pkg value inside each zone's tarball, and are an eclectic bunch that don't map neatly to the other methods (some use underscores, some use dashes, and some append a -zone suffix)

Can we collapse some of these (with work to make the users of them use more consistent names)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions