package hostops import ( "github.com/carlosframework/platform/internal/hostclaim" "github.com/carlosframework/platform/internal/regionname" ) func consoleHomeRegion(names []string) (string, error) { if len(names) > 1 { return "", ErrContract } home := "" if len(names) == 1 { home = names[0] } if home != "" && regionname.PlacementRegion(home) != home { return "", ErrContract } return home, nil } // Check the configured designation before interpreting an operation's alias. // An operation that recorded no home name started alias-free (before any // designation was published) and stays alias-free, so a later first // publication does not strand it: its comparisons stay exact. func operationHomeMatches(home string, c *hostclaim.Claim) bool { if c == nil || c.Op.Intent["home_region"] == "" { return true } return c.Op.Intent["home_region"] == home }