Skip to content

Commit

Permalink
microcloud/cmd/microcloud: apply config for when a custom encaps Gene…
Browse files Browse the repository at this point in the history
…ve IP is needed

Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
  • Loading branch information
gabrielmougard committed Jul 4, 2024
1 parent 6f315ae commit 899cd9c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/microcloud/main_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,20 @@ func setupCluster(s *service.Handler, systems map[string]InitSystem) error {
}
}

if s.Type() == types.MicroOVN {
microOvnBootstrapConf := make(map[string]string)
for _, system := range systems {
// If the system needs to be bootstrapped with a custom ovn encapsulation ip for geneve, add it to the init config.
if system.OVNGeneveAddr != "" {
microOvnBootstrapConf[fmt.Sprintf("%s.ovn-encap-ip", system.ServerInfo.Name)] = system.OVNGeneveAddr
}
}

if len(microOvnBootstrapConf) > 0 {
s.SetConfig(microOvnBootstrapConf)
}
}

// set a 2 minute timeout to bootstrap a service in case the node is slow.
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
Expand Down

0 comments on commit 899cd9c

Please sign in to comment.