Skip to content

Commit

Permalink
remove log print
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
  • Loading branch information
kradalby authored and juanfont committed Nov 23, 2024
1 parent 0a82d3f commit d72663a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions hscontrol/policy/acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ func (pol *ACLPolicy) CompileFilterRules(
for srcIndex, src := range acl.Sources {
srcs, err := pol.expandSource(src, nodes)
if err != nil {
return nil, fmt.Errorf("parsing policy, acl index: %d->%d: %w", index, srcIndex, err)
return nil, fmt.Errorf(
"parsing policy, acl index: %d->%d: %w",
index,
srcIndex,
err,
)
}
srcIPs = append(srcIPs, srcs...)
}
Expand Down Expand Up @@ -335,12 +340,21 @@ func (pol *ACLPolicy) CompileSSHPolicy(
case "check":
checkAction, err := sshCheckAction(sshACL.CheckPeriod)
if err != nil {
return nil, fmt.Errorf("parsing SSH policy, parsing check duration, index: %d: %w", index, err)
return nil, fmt.Errorf(
"parsing SSH policy, parsing check duration, index: %d: %w",
index,
err,
)
} else {
action = *checkAction
}
default:
return nil, fmt.Errorf("parsing SSH policy, unknown action %q, index: %d: %w", sshACL.Action, index, err)
return nil, fmt.Errorf(
"parsing SSH policy, unknown action %q, index: %d: %w",
sshACL.Action,
index,
err,
)
}

principals := make([]*tailcfg.SSHPrincipal, 0, len(sshACL.Sources))
Expand Down Expand Up @@ -977,10 +991,7 @@ func FilterNodesByACL(
continue
}

log.Printf("Checking if %s can access %s", node.Hostname, peer.Hostname)

if node.CanAccess(filter, nodes[index]) || peer.CanAccess(filter, node) {
log.Printf("CAN ACCESS %s can access %s", node.Hostname, peer.Hostname)
result = append(result, peer)
}
}
Expand Down

0 comments on commit d72663a

Please sign in to comment.