mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 16:26:52 +01:00
Compare a firewall reload with what the running firewall was built from (#1955)
This commit is contained in:
1 parent
cacfa8fac4
commit
b04d71d96a
4 files changed
+83
-8
No files matched your search
@@ -86,6 +86,21 @@ func (c *C) InitialLoad() bool {
|
||||
return c.oldSettings == nil
|
||||
}
|
||||
|
||||
// Render returns keys and their values as yaml, for a subsystem to remember what it applied. Empty means they couldn't
|
||||
// be rendered and should never match.
|
||||
func (c *C) Render(keys ...string) string {
|
||||
m := make(map[string]any, len(keys))
|
||||
for _, k := range keys {
|
||||
m[k] = c.Get(k)
|
||||
}
|
||||
b, err := yaml.Marshal(m)
|
||||
if err != nil {
|
||||
c.l.Debug("Failed to render config", "keys", keys, "error", err)
|
||||
return ""
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
// HasChanged checks if the underlying structure of the provided key has changed after a config reload. The value of
|
||||
// k in both the old and new settings will be serialized, the result of the string comparison is returned.
|
||||
// If k is an empty string the entire config is tested.
|
||||
|
||||
Reference in new issue
Block a user