Skip to content

Commit

Permalink
Merge pull request juju#633 from howbazaar/fix-gccgo-failure
Browse files Browse the repository at this point in the history
Rework auth checks for gccgo.

gccgo has problems comparing concrete types and interfaces. I'm betting it is actually only interfaces implemented by non-pointer types, but hey, I'm not a compiler writer.\

Reworks the auth checks.
  • Loading branch information
jujubot committed Aug 29, 2014
2 parents f8ff456 + a168b5e commit a55e943
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion state/apiserver/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ func NewDeployerAPI(
// Then we just check if the unit is already known.
return func(tag names.Tag) bool {
for _, unit := range units {
if names.NewUnitTag(unit) == tag {
// TODO (thumper): remove the names.Tag conversion when gccgo
// implements concrete-type-to-interface comparison correctly.
if names.Tag(names.NewUnitTag(unit)) == tag {
return true
}
}
Expand Down
5 changes: 4 additions & 1 deletion state/apiserver/networker/networker.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ func NewNetworkerAPI(
id := tag.Id()
for parentId := state.ParentId(id); parentId != ""; parentId = state.ParentId(parentId) {
// Until a top-level machine is reached.
if names.NewMachineTag(parentId) == authEntityTag {

// TODO (thumper): remove the names.Tag conversion when gccgo
// implements concrete-type-to-interface comparison correctly.
if names.Tag(names.NewMachineTag(parentId)) == authEntityTag {
// All containers with the authenticated machine as a
// parent are accessible by it.
return true
Expand Down

0 comments on commit a55e943

Please sign in to comment.