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
state: Make GetOwnerTag return names.UserTag #713
Conversation
owner := s.doc.OwnerTag | ||
if owner == "" { | ||
// We know that if there was no owner, it was created with an early | ||
// version of juju, and that admin was the only user. | ||
owner = names.NewUserTag("admin").String() | ||
owner = "admin" |
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.
return names.NewUserTag("admin")
Update service.GetOwnerTag() to return a names.UserTag instead of a string.
661bd86
to
9be2839
Compare
PTAL |
LGTM, pending mentor approval @fwereade |
@@ -620,14 +620,18 @@ func (s *Service) addUnitOps(principalName string, asserts bson.D) (string, []tx | |||
|
|||
// SCHEMACHANGE | |||
// TODO(mattyw) remove when schema upgrades are possible | |||
func (s *Service) GetOwnerTag() string { | |||
func (s *Service) GetOwnerTag() (names.UserTag, error) { |
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.
Please fix the comment on this method
make the method return names.Tag, error
LGTM with minor comments |
@howbazaar was in two minds whether to land this or remove GetOwnerTag altogether. @fwereade can you make the call please? |
No activity for a long time and no corresponding ReviewBoard diff. Closing. |
Update service.GetOwnerTag() to return a names.UserTag instead of a
string.