Get peer config via cluster API

This commit is contained in:
Ingo Oppermann
2023-06-26 10:35:00 +02:00
parent 7bb4103c00
commit 6f47f96f6e
3 changed files with 52 additions and 116 deletions

View File

@@ -721,7 +721,7 @@ func (c *cluster) checkClusterNodes() error {
return fmt.Errorf("node %s has a different version: %s: %w", id, version, err)
}
config, err := node.Config()
config, err := node.CoreConfig()
if err != nil {
return fmt.Errorf("node %s has no configuration available: %w", id, err)
}
@@ -783,6 +783,14 @@ func verifyClusterConfig(local, remote *config.Config) error {
return fmt.Errorf("srt.passphrase is different")
}
if local.Resources.MaxCPUUsage == 0 || remote.Resources.MaxCPUUsage == 0 {
return fmt.Errorf("resources.max_cpu_usage must be defined")
}
if local.Resources.MaxMemoryUsage == 0 || remote.Resources.MaxMemoryUsage == 0 {
return fmt.Errorf("resources.max_memory_usage must be defined")
}
return nil
}