A node is treated as a bootstrapper if either: - `force_bootstrap = true` (operator override), or - it is the lexicographically smallest seed and its `listen` address is among the seeds (the standard single-node / first-in-cluster path).
(settings: &ClusterSettings)
| 150 | /// - it is the lexicographically smallest seed and its `listen` address is |
| 151 | /// among the seeds (the standard single-node / first-in-cluster path). |
| 152 | fn is_bootstrapping_node(settings: &ClusterSettings) -> bool { |
| 153 | if settings.force_bootstrap { |
| 154 | return true; |
| 155 | } |
| 156 | let mut seeds = settings.seed_nodes.clone(); |
| 157 | seeds.sort(); |
| 158 | seeds.first() == Some(&settings.listen) && seeds.contains(&settings.listen) |
| 159 | } |
| 160 | |
| 161 | fn load_from_paths(paths: &TlsPaths, tls_dir: &Path) -> crate::Result<TlsCredentials> { |
| 162 | let cert = read_single_cert(&paths.cert)?; |
no test coverage detected