Skip to content

Commit

Permalink
many: rename registry role s/manager/custodian
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
  • Loading branch information
miguelpires committed Sep 13, 2024
1 parent 3b2350f commit 3165d09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions interfaces/builtin/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ func (iface *registryInterface) BeforePreparePlug(plug *snap.PlugInfo) error {
}

// by default, snaps can read/write registries and be notified of changes. The
// manager role allows snaps to change, reject and persist changes made by others
// custodian role allows snaps to change, reject and persist changes made by others
role, ok := plug.Attrs["role"].(string)
if ok && role != "manager" {
return fmt.Errorf(`optional registry plug "role" attribute must be "manager"`)
if ok && role != "custodian" {
return fmt.Errorf(`optional registry plug "role" attribute must be "custodian"`)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions interfaces/builtin/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (s *registrySuite) TestRegistrySanitizePlug(c *C) {
{
account: "my-acc",
view: "network/wifi",
role: "manager",
role: "custodian",
},
{
account: "my-acc",
Expand All @@ -109,7 +109,7 @@ func (s *registrySuite) TestRegistrySanitizePlug(c *C) {
account: "my-acc",
view: "reg/view",
role: "observer",
err: `optional registry plug "role" attribute must be "manager"`,
err: `optional registry plug "role" attribute must be "custodian"`,
},
{
account: "my-acc",
Expand Down
2 changes: 1 addition & 1 deletion overlord/hookstate/ctlcmd/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ plugs:
interface: registry
account: %[1]s
view: network/write-wifi
role: manager
role: custodian
`, s.devAccID)
info := mockInstalledSnap(c, s.state, snapYaml, "")

Expand Down
2 changes: 1 addition & 1 deletion snap/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,7 @@ func (s *infoSuite) TestRegistryPlugAttrs(c *C) {
Attrs: map[string]interface{}{
"account": "foo",
"view": "bar/baz",
"role": "manager",
"role": "custodian",
},
}

Expand Down

0 comments on commit 3165d09

Please sign in to comment.