f-55: lab: provision générique des nœuds, rôle host, two installé par test/e2e #55
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
4438bb3916
commit
f713f482fa
22 changed files with 481 additions and 369 deletions
|
|
@ -31,7 +31,9 @@ type Options struct {
|
|||
RunDir string
|
||||
AuthorizedKeys []string
|
||||
FRR map[string]string
|
||||
Agent map[string]string
|
||||
Provision map[string]string
|
||||
PostProvision map[string]string
|
||||
Files map[string]map[string][]byte
|
||||
}
|
||||
|
||||
type Node struct {
|
||||
|
|
@ -51,8 +53,16 @@ func Render(p *topology.Plan, o Options) ([]Node, error) {
|
|||
if _, ok := o.FRR[n.Name]; n.FRR != "" && !ok {
|
||||
return nil, fmt.Errorf("node %s: frr configuration %s was not read", n.Name, n.FRR)
|
||||
}
|
||||
if _, ok := o.Agent[n.Name]; n.Agent != "" && !ok {
|
||||
return nil, fmt.Errorf("node %s: agent configuration %s was not read", n.Name, n.Agent)
|
||||
if _, ok := o.Provision[n.Name]; n.Provision != "" && !ok {
|
||||
return nil, fmt.Errorf("node %s: provision script %s was not read", n.Name, n.Provision)
|
||||
}
|
||||
if _, ok := o.PostProvision[n.Name]; n.PostProvision != "" && !ok {
|
||||
return nil, fmt.Errorf("node %s: post_provision script %s was not read", n.Name, n.PostProvision)
|
||||
}
|
||||
for name, src := range n.Files {
|
||||
if _, ok := o.Files[n.Name][name]; !ok {
|
||||
return nil, fmt.Errorf("node %s: file %s (%s) was not read", n.Name, name, src)
|
||||
}
|
||||
}
|
||||
}
|
||||
var nodes []Node
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ segments:
|
|||
nodes:
|
||||
sw1: { role: switch, image: deb, cpus: 2, memory: 1024 }
|
||||
rr1: { role: rr, image: deb, cpus: 1, memory: 1024, segments: [underlay] }
|
||||
hv1: { role: hypervisor, image: deb, cpus: 4, memory: 16384, segments: [underlay], release: 0.2.0rc002 }
|
||||
hv2: { role: hypervisor, image: deb, cpus: 4, memory: 16384, segments: [underlay], release: 0.2.0rc002 }
|
||||
hv1: { role: host, image: deb, cpus: 4, memory: 16384, segments: [underlay] }
|
||||
hv2: { role: host, image: deb, cpus: 4, memory: 16384, segments: [underlay] }
|
||||
`
|
||||
|
||||
const twoSegments = `name: two-seg
|
||||
|
|
@ -36,7 +36,7 @@ segments:
|
|||
blue: { switch: sw, cidr: 10.2.0.0/24, mtu: 1500 }
|
||||
nodes:
|
||||
sw: { role: switch, image: deb, cpus: 1, memory: 512 }
|
||||
hv: { role: hypervisor, image: deb, cpus: 1, memory: 512, segments: [blue, red], release: 0.2.0rc002 }
|
||||
hv: { role: host, image: deb, cpus: 1, memory: 512, segments: [blue, red] }
|
||||
`
|
||||
|
||||
func plan(t *testing.T, doc string) *topology.Plan {
|
||||
|
|
@ -315,9 +315,9 @@ func TestNetworkConfig_DefaultRouteOnlyOnFirstSegment(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestUserData_Hypervisor(t *testing.T) {
|
||||
func TestUserData_HostWithoutProvision(t *testing.T) {
|
||||
cfg := user(t, nodeNamed(t, renderAll(t, twoHypervisors), "hv1"))
|
||||
if cfg.Hostname != "hv1" || !cfg.DisableRoot || len(cfg.Packages) != 0 || !reflect.DeepEqual(cfg.Runcmd, [][]string{{"/usr/local/sbin/lab-provision"}}) {
|
||||
if cfg.Hostname != "hv1" || !cfg.DisableRoot || len(cfg.Packages) != 0 || cfg.Runcmd != nil || len(cfg.WriteFiles) != 0 {
|
||||
t.Errorf("hv1 user-data = %+v", cfg)
|
||||
}
|
||||
if !reflect.DeepEqual(cfg.SSHAuthorizedKeys, []string{labKey}) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
package render
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
|
@ -21,8 +19,8 @@ segments:
|
|||
nodes:
|
||||
sw1: { role: switch, image: deb, cpus: 2, memory: 1024, secondary: { underlay: [169.254.0.1/28] }, frr: sw1.conf }
|
||||
rr1: { role: rr, image: deb, cpus: 1, memory: 1024, segments: [underlay], secondary: { underlay: [169.254.0.3/28] }, loopback: 10.255.255.1/32, frr: rr1.conf }
|
||||
hv1: { role: hypervisor, image: deb, cpus: 4, memory: 16384, segments: [underlay], frr: hv1.conf, release: 0.2.0rc002 }
|
||||
hv2: { role: hypervisor, image: deb, cpus: 4, memory: 16384, segments: [underlay], release: 0.2.0rc002 }
|
||||
hv1: { role: host, image: deb, cpus: 4, memory: 16384, segments: [underlay], frr: hv1.conf, provision: hv.sh, post_provision: hv-post.sh, files: { agent.yml: two.yml }, services: [agent.service] }
|
||||
hv2: { role: host, image: deb, cpus: 4, memory: 16384, segments: [underlay] }
|
||||
`
|
||||
|
||||
var frrConfigs = map[string]string{
|
||||
|
|
@ -31,9 +29,20 @@ var frrConfigs = map[string]string{
|
|||
"hv1": "hostname hv1\nrouter bgp 64600\n",
|
||||
}
|
||||
|
||||
func roleOptions() Options {
|
||||
return Options{
|
||||
RunDir: "/srv/lab",
|
||||
AuthorizedKeys: []string{labKey},
|
||||
FRR: frrConfigs,
|
||||
Provision: map[string]string{"hv1": "#!/bin/sh\necho provision\n"},
|
||||
PostProvision: map[string]string{"hv1": "#!/bin/sh\necho post\n"},
|
||||
Files: map[string]map[string][]byte{"hv1": {"agent.yml": []byte("dhcp:\n backend: two\n")}},
|
||||
}
|
||||
}
|
||||
|
||||
func renderRoles(t *testing.T) map[string]Node {
|
||||
t.Helper()
|
||||
nodes, err := Render(plan(t, withRoles), Options{RunDir: "/srv/lab", AuthorizedKeys: []string{labKey}, FRR: frrConfigs})
|
||||
nodes, err := Render(plan(t, withRoles), roleOptions())
|
||||
if err != nil {
|
||||
t.Fatalf("Render: %v", err)
|
||||
}
|
||||
|
|
@ -145,10 +154,10 @@ func TestRoles_FRRKeyIsThePinnedRepositoryKey(t *testing.T) {
|
|||
|
||||
func TestRoles_ProvisioningIsOneScriptThatStopsAtTheFirstFailure(t *testing.T) {
|
||||
nodes := renderRoles(t)
|
||||
env := "LAB_NODE=hv1 LAB_UPLINK=underlay LAB_FILES=/etc/lab/files "
|
||||
for name, steps := range map[string]string{
|
||||
"sw1": "systemctl daemon-reload\nsystemctl enable --now lab-switch.service\n/usr/local/sbin/lab-frr\n",
|
||||
"hv1": "/usr/local/sbin/lab-deploy\n/usr/local/sbin/lab-frr\nsystemctl restart agent.service\n",
|
||||
"hv2": "/usr/local/sbin/lab-deploy\n",
|
||||
"hv1": env + "/usr/local/sbin/lab-node-provision\n/usr/local/sbin/lab-frr\n" + env + "/usr/local/sbin/lab-node-post-provision\n",
|
||||
} {
|
||||
cfg := user(t, nodeNamed(t, nodes, name))
|
||||
if !reflect.DeepEqual(cfg.Runcmd, [][]string{{"/usr/local/sbin/lab-provision"}}) {
|
||||
|
|
@ -159,47 +168,34 @@ func TestRoles_ProvisioningIsOneScriptThatStopsAtTheFirstFailure(t *testing.T) {
|
|||
t.Errorf("%s lab-provision (%s):\n%s", name, f.Permissions, f.Content)
|
||||
}
|
||||
}
|
||||
if cfg := user(t, nodeNamed(t, nodes, "hv2")); cfg.Runcmd != nil {
|
||||
t.Errorf("hv2 has nothing to provision, runcmd = %q", cfg.Runcmd)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRoles_HypervisorDeploysTheReleaseThroughTheRepositoryScripts(t *testing.T) {
|
||||
func TestRoles_HostReceivesItsScriptsAndFiles(t *testing.T) {
|
||||
cfg := user(t, nodeNamed(t, renderRoles(t), "hv1"))
|
||||
|
||||
f := fileAt(t, cfg, "/usr/local/sbin/lab-deploy")
|
||||
want := `#!/bin/sh
|
||||
set -eu
|
||||
n=0
|
||||
until curl -fsS -o /dev/null https://git.g3e.fr/; do
|
||||
n=$((n + 1))
|
||||
[ "$n" -lt 30 ] || exit 1
|
||||
sleep 10
|
||||
done
|
||||
cd /opt/two/scripts
|
||||
bash ./deploy.sh --noup_script -i -u underlay -t 0.2.0rc002
|
||||
`
|
||||
if f.Content != want || f.Permissions != "0755" {
|
||||
t.Errorf("lab-deploy (%s):\n%s\nwant:\n%s", f.Permissions, f.Content, want)
|
||||
}
|
||||
|
||||
for path, source := range map[string]string{
|
||||
"/opt/two/scripts/deploy.sh": "../../../scripts/deploy.sh",
|
||||
"/opt/two/scripts/bootstrap_kvm.sh": "../../../scripts/bootstrap_kvm.sh",
|
||||
for path, want := range map[string]struct {
|
||||
content string
|
||||
permissions string
|
||||
}{
|
||||
"/usr/local/sbin/lab-node-provision": {"#!/bin/sh\necho provision\n", "0755"},
|
||||
"/usr/local/sbin/lab-node-post-provision": {"#!/bin/sh\necho post\n", "0755"},
|
||||
"/etc/lab/files/agent.yml": {"dhcp:\n backend: two\n", "0644"},
|
||||
} {
|
||||
f := fileAt(t, cfg, path)
|
||||
got, err := base64.StdEncoding.DecodeString(f.Content)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
repo, err := os.ReadFile(source)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if f.Encoding != "b64" || f.Permissions != "0755" || !bytes.Equal(got, repo) {
|
||||
t.Errorf("%s: encoding %q, permissions %q, identical to %s: %v", path, f.Encoding, f.Permissions, source, bytes.Equal(got, repo))
|
||||
if f.Encoding != "b64" || f.Permissions != want.permissions || string(got) != want.content {
|
||||
t.Errorf("%s: encoding %q, permissions %q, content %q", path, f.Encoding, f.Permissions, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRoles_UplinkIsTheInterfaceCarryingTheDefaultRoute(t *testing.T) {
|
||||
p := plan(t, twoSegments)
|
||||
hv := nodeNamed(t, renderAll(t, twoSegments), "hv")
|
||||
var withDefault []string
|
||||
for name, e := range network(t, hv).Ethernets {
|
||||
|
|
@ -212,22 +208,36 @@ func TestRoles_UplinkIsTheInterfaceCarryingTheDefaultRoute(t *testing.T) {
|
|||
if !reflect.DeepEqual(withDefault, []string{"red"}) {
|
||||
t.Fatalf("default route on %v, want [red]", withDefault)
|
||||
}
|
||||
if got := fileAt(t, user(t, hv), "/usr/local/sbin/lab-deploy").Content; !strings.HasSuffix(got, "bash ./deploy.sh --noup_script -i -u red -t 0.2.0rc002\n") {
|
||||
t.Errorf("lab-deploy:\n%s", got)
|
||||
for _, n := range p.Nodes {
|
||||
if n.Name == "hv" {
|
||||
if got := provisionEnv(p, n); got != "LAB_NODE=hv LAB_UPLINK=red LAB_FILES=/etc/lab/files " {
|
||||
t.Errorf("provision environment = %q", got)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRoles_OnlyHypervisorsDeployTwo(t *testing.T) {
|
||||
func TestRoles_NodesWithoutProvisionReceiveNoProvisionFiles(t *testing.T) {
|
||||
nodes := renderRoles(t)
|
||||
for _, name := range []string{"sw1", "rr1"} {
|
||||
for _, name := range []string{"sw1", "rr1", "hv2"} {
|
||||
for _, f := range user(t, nodeNamed(t, nodes, name)).WriteFiles {
|
||||
if strings.HasPrefix(f.Path, "/opt/two/") || f.Path == "/usr/local/sbin/lab-deploy" {
|
||||
if strings.HasPrefix(f.Path, "/etc/lab/files/") || strings.HasPrefix(f.Path, "/usr/local/sbin/lab-node-") {
|
||||
t.Errorf("%s receives %s", name, f.Path)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRoles_FRRDaemons(t *testing.T) {
|
||||
p := plan(t, withRoles)
|
||||
want := map[string][]string{"sw1": {"bgpd", "bfdd"}, "rr1": {"bgpd", "bfdd"}, "hv1": {"bgpd"}}
|
||||
for _, n := range p.Nodes {
|
||||
if w, ok := want[n.Name]; ok && !reflect.DeepEqual(frrDaemons(n), w) {
|
||||
t.Errorf("%s daemons = %v, want %v", n.Name, frrDaemons(n), w)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRoles_NodeWithoutRoleFieldsGetsNoFRR(t *testing.T) {
|
||||
for _, f := range user(t, nodeNamed(t, renderRoles(t), "hv2")).WriteFiles {
|
||||
if strings.Contains(f.Path, "frr") {
|
||||
|
|
@ -246,7 +256,7 @@ func TestRoles_RefusesAnUnreadFRRConfig(t *testing.T) {
|
|||
|
||||
func TestRoles_SwitchLoopbackIsCreatedByTheSwitchScript(t *testing.T) {
|
||||
doc := strings.Replace(withRoles, "secondary: { underlay: [169.254.0.1/28] }, frr: sw1.conf", "secondary: { underlay: [169.254.0.1/28] }, loopback: 10.255.254.1/32, frr: sw1.conf", 1)
|
||||
nodes, err := Render(plan(t, doc), Options{RunDir: "/srv/lab", AuthorizedKeys: []string{labKey}, FRR: frrConfigs})
|
||||
nodes, err := Render(plan(t, doc), roleOptions())
|
||||
if err != nil {
|
||||
t.Fatalf("Render: %v", err)
|
||||
}
|
||||
|
|
@ -263,36 +273,20 @@ func TestRoles_SwitchLoopbackIsCreatedByTheSwitchScript(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestRoles_HypervisorAgentConfigIsWrittenBeforeTheDeployment(t *testing.T) {
|
||||
doc := strings.Replace(withRoles, "frr: hv1.conf, release: 0.2.0rc002 }", "frr: hv1.conf, release: 0.2.0rc002, agent: two.yml }", 1)
|
||||
nodes, err := Render(plan(t, doc), Options{RunDir: "/srv/lab", AuthorizedKeys: []string{labKey}, FRR: frrConfigs, Agent: map[string]string{"hv1": "dhcp:\n backend: two\n"}})
|
||||
if err != nil {
|
||||
t.Fatalf("Render: %v", err)
|
||||
func TestRoles_RefusesUnreadProvisionInputs(t *testing.T) {
|
||||
cases := map[string]struct {
|
||||
mutate func(*Options)
|
||||
want string
|
||||
}{
|
||||
"provision": {func(o *Options) { o.Provision = nil }, "node hv1: provision script hv.sh was not read"},
|
||||
"post": {func(o *Options) { o.PostProvision = nil }, "node hv1: post_provision script hv-post.sh was not read"},
|
||||
"file": {func(o *Options) { o.Files = nil }, "node hv1: file agent.yml (two.yml) was not read"},
|
||||
}
|
||||
var hv1, hv2 Node
|
||||
for _, n := range nodes {
|
||||
switch n.Name {
|
||||
case "hv1":
|
||||
hv1 = n
|
||||
case "hv2":
|
||||
hv2 = n
|
||||
}
|
||||
}
|
||||
f := fileAt(t, user(t, hv1), "/etc/two/agent.yml")
|
||||
if f.Content != "dhcp:\n backend: two\n" || f.Permissions != "0640" {
|
||||
t.Errorf("agent.yml (%s) = %q", f.Permissions, f.Content)
|
||||
}
|
||||
for _, w := range user(t, hv2).WriteFiles {
|
||||
if w.Path == "/etc/two/agent.yml" {
|
||||
t.Error("hv2 receives an agent.yml it does not declare")
|
||||
for name, c := range cases {
|
||||
o := roleOptions()
|
||||
c.mutate(&o)
|
||||
if _, err := Render(plan(t, withRoles), o); err == nil || err.Error() != c.want {
|
||||
t.Errorf("%s: error = %v, want %q", name, err, c.want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRoles_RefusesAnUnreadAgentConfig(t *testing.T) {
|
||||
doc := strings.Replace(withRoles, "frr: hv1.conf, release: 0.2.0rc002 }", "frr: hv1.conf, release: 0.2.0rc002, agent: two.yml }", 1)
|
||||
_, err := Render(plan(t, doc), Options{RunDir: "/srv/lab", AuthorizedKeys: []string{labKey}, FRR: frrConfigs})
|
||||
if err == nil || err.Error() != "node hv1: agent configuration two.yml was not read" {
|
||||
t.Errorf("error = %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import (
|
|||
_ "embed"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"go.yaml.in/yaml/v3"
|
||||
|
||||
"git.g3e.fr/syonad/two/internal/lab/topology"
|
||||
"git.g3e.fr/syonad/two/scripts"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -27,11 +27,10 @@ const (
|
|||
FRRRepo = "https://deb.frrouting.org/frr"
|
||||
FRRPackages = "frr frr-pythontools"
|
||||
|
||||
ProvisionScript = "/usr/local/sbin/lab-provision"
|
||||
DeployScript = "/usr/local/sbin/lab-deploy"
|
||||
TwoScriptsDir = "/opt/two/scripts"
|
||||
TwoGitServer = "https://git.g3e.fr/"
|
||||
AgentConfig = "/etc/two/agent.yml"
|
||||
ProvisionScript = "/usr/local/sbin/lab-provision"
|
||||
NodeProvision = "/usr/local/sbin/lab-node-provision"
|
||||
NodePostProvision = "/usr/local/sbin/lab-node-post-provision"
|
||||
FilesDir = "/etc/lab/files"
|
||||
)
|
||||
|
||||
//go:embed frrouting.gpg
|
||||
|
|
@ -115,16 +114,17 @@ func userData(p *topology.Plan, n topology.NodePlan, o Options) ([]byte, error)
|
|||
}
|
||||
steps = append(steps, "systemctl daemon-reload", "systemctl enable --now lab-node.service")
|
||||
}
|
||||
if n.Agent != "" {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles, writeFile{Path: AgentConfig, Permissions: "0640", Content: o.Agent[n.Name]})
|
||||
names := make([]string, 0, len(n.Files))
|
||||
for name := range n.Files {
|
||||
names = append(names, name)
|
||||
}
|
||||
if n.Role == topology.RoleHypervisor {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles,
|
||||
writeFile{Path: TwoScriptsDir + "/deploy.sh", Permissions: "0755", Encoding: "b64", Content: base64.StdEncoding.EncodeToString(scripts.Deploy)},
|
||||
writeFile{Path: TwoScriptsDir + "/bootstrap_kvm.sh", Permissions: "0755", Encoding: "b64", Content: base64.StdEncoding.EncodeToString(scripts.BootstrapKVM)},
|
||||
writeFile{Path: DeployScript, Permissions: "0755", Content: deployScript(p, n)},
|
||||
)
|
||||
steps = append(steps, DeployScript)
|
||||
sort.Strings(names)
|
||||
for _, name := range names {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles, writeFile{Path: FilesDir + "/" + name, Permissions: "0644", Encoding: "b64", Content: base64.StdEncoding.EncodeToString(o.Files[n.Name][name])})
|
||||
}
|
||||
if n.Provision != "" {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles, writeFile{Path: NodeProvision, Permissions: "0755", Encoding: "b64", Content: base64.StdEncoding.EncodeToString([]byte(o.Provision[n.Name]))})
|
||||
steps = append(steps, provisionEnv(p, n)+NodeProvision)
|
||||
}
|
||||
if n.FRR != "" {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles,
|
||||
|
|
@ -133,9 +133,10 @@ func userData(p *topology.Plan, n topology.NodePlan, o Options) ([]byte, error)
|
|||
writeFile{Path: FRRScript, Permissions: "0755", Content: frrScript(n)},
|
||||
)
|
||||
steps = append(steps, FRRScript)
|
||||
if n.Role == topology.RoleHypervisor {
|
||||
steps = append(steps, "systemctl restart agent.service")
|
||||
}
|
||||
}
|
||||
if n.PostProvision != "" {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles, writeFile{Path: NodePostProvision, Permissions: "0755", Encoding: "b64", Content: base64.StdEncoding.EncodeToString([]byte(o.PostProvision[n.Name]))})
|
||||
steps = append(steps, provisionEnv(p, n)+NodePostProvision)
|
||||
}
|
||||
if len(steps) > 0 {
|
||||
cfg.WriteFiles = append(cfg.WriteFiles,
|
||||
|
|
@ -154,16 +155,16 @@ func retry(command string) string {
|
|||
return "n=0\nuntil " + command + "; do\n n=$((n + 1))\n [ \"$n\" -lt 30 ] || exit 1\n sleep 10\ndone\n"
|
||||
}
|
||||
|
||||
func deployScript(p *topology.Plan, n topology.NodePlan) string {
|
||||
uplink := nodeCables(p, n.Name)[0].NodeInterface
|
||||
return "#!/bin/sh\nset -eu\n" +
|
||||
retry("curl -fsS -o /dev/null "+TwoGitServer) +
|
||||
"cd " + TwoScriptsDir + "\n" +
|
||||
fmt.Sprintf("bash ./deploy.sh --noup_script -i -u %s -t %s\n", uplink, n.Release)
|
||||
func provisionEnv(p *topology.Plan, n topology.NodePlan) string {
|
||||
uplink := ""
|
||||
if cables := nodeCables(p, n.Name); len(cables) > 0 {
|
||||
uplink = cables[0].NodeInterface
|
||||
}
|
||||
return fmt.Sprintf("LAB_NODE=%s LAB_UPLINK=%s LAB_FILES=%s ", n.Name, uplink, FilesDir)
|
||||
}
|
||||
|
||||
func frrDaemons(n topology.NodePlan) []string {
|
||||
if n.Role == topology.RoleHypervisor {
|
||||
if n.Role == topology.RoleHost {
|
||||
return []string{"bgpd"}
|
||||
}
|
||||
return []string{"bgpd", "bfdd"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue