File tree 2 files changed +7
-16
lines changed 2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,10 @@ func NewDeployerAPI(
49
49
}
50
50
// Then we just check if the unit is already known.
51
51
return func (tag names.Tag ) bool {
52
- // gcc has horrible problems comparing types and interfaces
53
- // so convert to concrete types.
54
- utag , ok := tag .(names.UnitTag )
55
- if ! ok {
56
- return false
57
- }
58
52
for _ , unit := range units {
59
- if names .NewUnitTag (unit ) == utag {
53
+ // TODO (thumper): remove the names.Tag conversion when gccgo
54
+ // implements concrete-type-to-interface comparison correctly.
55
+ if names .Tag (names .NewUnitTag (unit )) == tag {
60
56
return true
61
57
}
62
58
}
Original file line number Diff line number Diff line change @@ -52,18 +52,13 @@ func NewNetworkerAPI(
52
52
// Only machine tags are allowed.
53
53
return false
54
54
}
55
-
56
- // gcc has horrible problems comparing types and interfaces
57
- // so convert to concrete types.
58
- authMachine , ok := authEntityTag .(names.MachineTag )
59
- if ! ok {
60
- // the auth tag should always be a machine...
61
- return false
62
- }
63
55
id := tag .Id ()
64
56
for parentId := state .ParentId (id ); parentId != "" ; parentId = state .ParentId (parentId ) {
65
57
// Until a top-level machine is reached.
66
- if names .NewMachineTag (parentId ) == authMachine {
58
+
59
+ // TODO (thumper): remove the names.Tag conversion when gccgo
60
+ // implements concrete-type-to-interface comparison correctly.
61
+ if names .Tag (names .NewMachineTag (parentId )) == authEntityTag {
67
62
// All containers with the authenticated machine as a
68
63
// parent are accessible by it.
69
64
return true
You can’t perform that action at this time.
0 commit comments