mirror of https://github.com/status-im/consul.git
upgrade test(LTS): import remaining agent config from usage profile (#19999)
* upgrade test(LTS): import remaining agent config from usage profile
This commit is contained in:
parent
d925e4b812
commit
8e2d4e3aaf
|
@ -25,6 +25,12 @@ func (g *Generator) generateAgentHCL(node *topology.Node, enableV2, enableV2Tena
|
|||
|
||||
var b HCLBuilder
|
||||
|
||||
// We first write ExtraConfig since it could be overwritten by specific
|
||||
// configurations below
|
||||
if node.ExtraConfig != "" {
|
||||
b.format(node.ExtraConfig)
|
||||
}
|
||||
|
||||
b.add("server", node.IsServer())
|
||||
b.add("bind_addr", "0.0.0.0")
|
||||
b.add("client_addr", "0.0.0.0")
|
||||
|
@ -49,6 +55,7 @@ func (g *Generator) generateAgentHCL(node *topology.Node, enableV2, enableV2Tena
|
|||
// speed up leaves
|
||||
b.addBlock("performance", func() {
|
||||
b.add("leave_drain_time", "50ms")
|
||||
b.add("raft_multiplier", 1)
|
||||
})
|
||||
|
||||
b.add("primary_datacenter", node.Datacenter)
|
||||
|
@ -61,6 +68,9 @@ func (g *Generator) generateAgentHCL(node *topology.Node, enableV2, enableV2Tena
|
|||
// }
|
||||
|
||||
if node.Segment != nil {
|
||||
if node.Kind != topology.NodeKindClient {
|
||||
panic("segment only applies to client agent")
|
||||
}
|
||||
b.add("segment", node.Segment.Name)
|
||||
b.addSlice("retry_join", []string{
|
||||
fmt.Sprintf("server.%s-consulcluster.lan:%d", node.Cluster, node.Segment.Port),
|
||||
|
|
|
@ -553,6 +553,9 @@ type Node struct {
|
|||
|
||||
// Network segment of the agent - applicable to client agent only
|
||||
Segment *NetworkSegment
|
||||
|
||||
// ExtraConfig is the extra config added to the node
|
||||
ExtraConfig string
|
||||
}
|
||||
|
||||
func (n *Node) DockerName() string {
|
||||
|
|
Loading…
Reference in New Issue