Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
many: rename two core plugs that clash with slot names #3154
Conversation
zyga
added this to the
2.24 milestone
Apr 7, 2017
This was referenced Apr 7, 2017
| + c.Assert(err, check.IsNil) | ||
| + snapInfo.SideInfo = *sideInfo | ||
| + err = snap.Validate(snapInfo) | ||
| + c.Assert(err, check.Not(check.IsNil)) |
zyga
added some commits
Apr 7, 2017
|
I removed the commit that renamed stored connection data so this no longer touches the state. The missing commit can be found in #3160 |
| @@ -538,6 +559,8 @@ func ReadInfo(name string, si *SideInfo) (*Info, error) { | ||
| return nil, err | ||
| } | ||
| + info.renameClashingCorePlugs() |
mvo5
Apr 10, 2017
Collaborator
Having this in two places makes me wonder if we should move it instead into InfoFromSnapYaml() ?
zyga
Apr 10, 2017
•
Contributor
I think we need to revisit this in general as some "fixup" is done in overlord/snapmgr and some here but I didn't want to do any wider changes. EDIT: Ideally all of broken.go would be private and would be applied internally.
mvo5
Apr 10, 2017
Collaborator
Yeah, my concern here is just that we have two places currently where we fixup things snap.go. I would really like to have only a single place.
zyga
added some commits
Apr 10, 2017
zyga
referenced this pull request
Apr 10, 2017
Merged
overlord/ifacestate: automatically rename connections on core snap #3160
| @@ -275,6 +275,27 @@ func (s *Info) NeedsClassic() bool { | ||
| return s.Confinement == ClassicConfinement | ||
| } | ||
| +// RenamePlug renames the plug from oldName to newName, if present | ||
| +func (s *Info) RenamePlug(oldName, newName string) { |
niemeyer
Apr 10, 2017
Contributor
This should be renamePlug inside broken.go rather than a public API. This is far from being a well supported or desired operation.
zyga commentedApr 7, 2017
•
Edited 1 time
-
zyga
Apr 10, 2017
This branch takes a proactive approach towards ensuring we don't have clashing plug and slot names
on the core snap. The core ships with "network-bind" and "core-support" plugs that clash with
the corresponding slot names. Because of missing validation this did not surface earlier.
Validation is added in a separate branch.
This branch focuses on automatically renaming the two plugs so that no clash occurs.
This has two parts:
snap.Info