mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-16 11:37:04 +02:00
* HCP link integration * update configure-git.yml * more OSS stuff * removing internal repos * adding a nil check * removing config test to be included in ENT only * updating hcp-sdk-go to v0.22.0 * remove Hostname and AuthURL link config params Co-authored-by: Chris Capurso <1036769+ccapurso@users.noreply.github.com>
71 lines
1.4 KiB
Go
71 lines
1.4 KiB
Go
package configutil
|
|
|
|
func (c *SharedConfig) Merge(c2 *SharedConfig) *SharedConfig {
|
|
if c2 == nil {
|
|
return c
|
|
}
|
|
|
|
result := new(SharedConfig)
|
|
|
|
for _, l := range c.Listeners {
|
|
result.Listeners = append(result.Listeners, l)
|
|
}
|
|
for _, l := range c2.Listeners {
|
|
result.Listeners = append(result.Listeners, l)
|
|
}
|
|
|
|
result.HCPLinkConf = c.HCPLinkConf
|
|
if c2.HCPLinkConf != nil {
|
|
result.HCPLinkConf = c2.HCPLinkConf
|
|
}
|
|
|
|
result.Entropy = c.Entropy
|
|
if c2.Entropy != nil {
|
|
result.Entropy = c2.Entropy
|
|
}
|
|
|
|
for _, s := range c.Seals {
|
|
result.Seals = append(result.Seals, s)
|
|
}
|
|
for _, s := range c2.Seals {
|
|
result.Seals = append(result.Seals, s)
|
|
}
|
|
|
|
result.Telemetry = c.Telemetry
|
|
if c2.Telemetry != nil {
|
|
result.Telemetry = c2.Telemetry
|
|
}
|
|
|
|
result.DisableMlock = c.DisableMlock
|
|
if c2.DisableMlock {
|
|
result.DisableMlock = c2.DisableMlock
|
|
}
|
|
|
|
result.DefaultMaxRequestDuration = c.DefaultMaxRequestDuration
|
|
if c2.DefaultMaxRequestDuration > result.DefaultMaxRequestDuration {
|
|
result.DefaultMaxRequestDuration = c2.DefaultMaxRequestDuration
|
|
}
|
|
|
|
result.LogLevel = c.LogLevel
|
|
if c2.LogLevel != "" {
|
|
result.LogLevel = c2.LogLevel
|
|
}
|
|
|
|
result.LogFormat = c.LogFormat
|
|
if c2.LogFormat != "" {
|
|
result.LogFormat = c2.LogFormat
|
|
}
|
|
|
|
result.PidFile = c.PidFile
|
|
if c2.PidFile != "" {
|
|
result.PidFile = c2.PidFile
|
|
}
|
|
|
|
result.ClusterName = c.ClusterName
|
|
if c2.ClusterName != "" {
|
|
result.ClusterName = c2.ClusterName
|
|
}
|
|
|
|
return result
|
|
}
|