mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-30 05:25:35 +00:00
3a635db06e
connector-gen can initially generate connector ACL snippets and advertise-routes flags for Github and AWS based on their public IP / domain data. Updates ENG-2425 Signed-off-by: James Tucker <james@tailscale.com>
23 lines
423 B
Go
23 lines
423 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"go4.org/netipx"
|
|
)
|
|
|
|
func advertiseRoutes(set *netipx.IPSet) {
|
|
fmt.Println()
|
|
prefixes := set.Prefixes()
|
|
pfxs := make([]string, 0, len(prefixes))
|
|
for _, pfx := range prefixes {
|
|
pfxs = append(pfxs, pfx.String())
|
|
}
|
|
fmt.Printf("--advertise-routes=%s", strings.Join(pfxs, ","))
|
|
fmt.Println()
|
|
}
|