Skip to content

Commit 2c86f29

Browse files
committed
fix: actually render full catalog of options + guard to catch stale options
Signed-off-by: Krish Dandiwala <kdandiwala@nvidia.com>
1 parent 935dec1 commit 2c86f29

6 files changed

Lines changed: 227 additions & 34 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/api-core/src/cfg/README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ applicable.
4545
| `machine_update_run_interval` | `Option<u64>` || `machines` | Interval (seconds) at which the machine update manager checks for updates. |
4646
| `retained_boot_interface_window` | `Option<Duration>` || `machines` | How long a retained boot interface pair (`retained_boot_interfaces` table) stays applicable after its `machine_interfaces` row was deleted. Unset retains forever; set a window (e.g. `30d`) so a MAC reappearing on different hardware doesn't inherit an obsolete Redfish interface id. |
4747
| `site_explorer` | `SiteExplorerConfig` | *(see below)* | `hardware` | SiteExplorer hardware discovery settings (see [SiteExplorerConfig](#siteexplorerconfig)). |
48-
| `nvue_enabled` | `bool` | `true` | `machines` | DPU agent uses NVUE for config instead of writing files directly. |
4948
| `vpc_peering_policy` | `Option<VpcPeeringPolicy>` || `networking` | Policy for VPC peering based on network virtualization type at creation time. |
5049
| `vpc_peering_policy_on_existing` | `Option<VpcPeeringPolicy>` || `networking` | Policy for whether existing VPC peerings should be active. |
5150
| `attestation_enabled` | `bool` | `false` | `security` | Enables TPM-based machine attestation (adds `Measuring` state before `Ready`). |
@@ -282,7 +281,8 @@ flows.
282281
| `nmx_c_tls_client_key_path` | `Option<String>` || Client private key for mTLS to NMX-C. |
283282
| `nmx_c_tls_authority` | `Option<String>` || TLS server name used for SNI and certificate verification. |
284283
| `allow_insecure` | `bool` | `false` | Skip TLS verification for NMX-C. |
285-
284+
| `nmx_c_endpoint_port` | `Option<u16>` || TCP port for NMX-C endpoints derived from switch NVOS IP. Unset uses the production NMX-C port. |
285+
| `nmx_c_certificate_rotation` | `NmxCCertificateRotationConfig` | *(default)* | Optional monitoring for NMX-C server certificate propagation. |
286286
### `SiteExplorerConfig`
287287

288288
| Field | Type | Default | Description |
@@ -306,9 +306,8 @@ flows.
306306
| `power_shelves_created_per_run` | `u64` | `1` | Max power shelves created per run. |
307307
| `create_switches` | `bool` | `false` | Auto-create Switch state machines. |
308308
| `switches_created_per_run` | `u64` | `9` | Max switches created per run. |
309-
| `use_onboard_nic` | `bool` | `false` | Use onboard NIC instead of DPU NICs. |
310309
| `explore_mode` | `SiteExplorerExploreMode` | `LibRedfish` | Redfish backend: `libredfish`, `nv-redfish`, or `compare-result`. |
311-
310+
| `dpu_mode` | `Option<DpuMode>` || Site-wide DPU operating mode. When set, applies to every host that doesn't declare a per-host `ExpectedMachine.dpu_mode` override. |
312311
### `StateControllerConfig`
313312

314313
Shared by all `*StateControllerConfig` structs (machine, network segment, VPC prefix, IB
@@ -346,23 +345,23 @@ Extends `StateControllerConfig` with:
346345
| `uefi_boot_wait` | `Duration` | `5m` | Wait time for UEFI boot completion after host reboot. |
347346
| `max_bios_config_retries` | `u32` | `3` | Max HandleBiosJobFailure recovery cycles during BIOS configuration. |
348347
| `polling_bios_setup_stuck_threshold` | `Duration` | `15m` | Time in PollingBiosSetup with `is_bios_setup == false` before recovery escalation. |
349-
348+
| `controller` | `StateControllerConfig` | *(default)* | Common state controller timing (see [StateControllerConfig](#statecontrollerconfig)). |
350349
### `NetworkSegmentStateControllerConfig`
351350

352351
Extends `StateControllerConfig` with:
353352

354353
| Field | Type | Default | Description |
355354
|-------|------|---------|-------------|
356355
| `network_segment_drain_time` | `Duration` | `5m` | Time a network segment must have 0 allocated IPs before release. |
357-
356+
| `controller` | `StateControllerConfig` | *(default)* | Common state controller timing (see [StateControllerConfig](#statecontrollerconfig)). |
358357
### `VpcPrefixStateControllerConfig`
359358

360359
Extends `StateControllerConfig` with:
361360

362361
| Field | Type | Default | Description |
363362
|-------|------|---------|-------------|
364363
| `vpc_prefix_drain_time` | `Duration` | `5m` | Time a VPC prefix must have 0 referencing network prefixes before release. |
365-
364+
| `controller` | `StateControllerConfig` | *(default)* | Common state controller timing (see [StateControllerConfig](#statecontrollerconfig)). |
366365
### `FirmwareGlobal`
367366

368367
| Field | Type | Default | Description |
@@ -379,7 +378,8 @@ Extends `StateControllerConfig` with:
379378
| `no_reset_retries` | `bool` | `false` | Disable retry logic after BMC resets. |
380379
| `hgx_bmc_gpu_reboot_delay` | `Duration` | `30s` | Delay after GPU reboot before HGX BMC access. |
381380
| `requires_manual_upgrade` | `bool` | `false` | Force all firmware upgrades to require admin approval. |
382-
381+
| `firmware_download_cache_directory` | `PathBuf` | `/mnt/persistence/fw/download-cache` | Writable directory used to cache downloaded firmware artifacts. |
382+
| `max_concurrent_bfb_copies` | `usize` | `10` | Maximum number of concurrent BFB copy operations. |
383383
### `MachineUpdater`
384384

385385
| Field | Type | Default | Description |
@@ -455,7 +455,7 @@ Extends `StateControllerConfig` with:
455455
| `common_internal_route_target` | `Option<RouteTargetConfig>` || Double-tag for internal tenant routes (consumed by the network infrastructure). |
456456
| `additional_route_target_imports` | `Vec<RouteTargetConfig>` | `[]` | Extra route targets imported on DPU VRFs. |
457457
| `routing_profiles` | `HashMap<String, FnnRoutingProfileConfig>` | `{}` | Named per-VPC routing profiles (see [FnnRoutingProfileConfig](#fnnroutingprofileconfig)). |
458-
458+
| `use_vpc_vrf_loopback` | `bool` | `false` | Whether IPs are allocated for VPC loopbacks. When false, the VPC loopback pool is unused and no VPC/VRF loopback IP is sent to the DPU. |
459459
### `FnnRoutingProfileConfig`
460460

461461
| Field | Type | Default | Description |
@@ -487,7 +487,7 @@ Extends `StateControllerConfig` with:
487487
| `subnet_mask` | `i32` | `0` | CIDR prefix length for the DPA subnet. |
488488
| `hb_interval` | `Duration` | `2m` | Heartbeat interval for DPA health checks. |
489489
| `auth` | `MqttAuthConfig` | *(none)* | MQTT authentication settings. |
490-
490+
| `monitor_run_interval` | `Duration` | `60s` | The interval at which the DPA monitor runs. |
491491
### `DsxExchangeEventBusConfig`
492492

493493
| Field | Type | Default | Description |
@@ -498,16 +498,16 @@ Extends `StateControllerConfig` with:
498498
| `publish_timeout` | `Duration` | `1s` | Timeout for MQTT publish operations. |
499499
| `queue_capacity` | `usize` | `1024` | Event buffer size for DSX publish work (events dropped when full). |
500500
| `auth` | `MqttAuthConfig` | *(none)* | MQTT authentication settings. |
501-
501+
| `topic_prefix` | `String` | `NICO/v1/machine` | Topic prefix used when publishing `ManagedHostState` transitions; the full topic is `{topic_prefix}/{machineId}/state`. NATS subjects are case-sensitive, so this must match the producer pub allow configured on the broker. |
502502
### `DpfConfig`
503503

504504
| Field | Type | Default | Description |
505505
|-------|------|---------|-------------|
506506
| `enabled` | `bool` | `false` | Enable DPF Kubernetes deployment. |
507-
| `bfb_url` | `String` | `""` | BlueField firmware bundle URL. |
508-
| `deployment_name` | `Option<String>` || Kubernetes deployment name. |
509507
| `services` | `Option<Vec<DpfServiceConfig>>` || Additional Helm services. |
510-
508+
| `docker_image_pull_secret` | `Option<String>` || Override for the Kubernetes `imagePullSecrets` entry used to pull mandatory-service images (applied to every mandatory service except `dts` and `doca_hbn`). |
509+
| `proxy` | `Option<DpfProxyDetails>` || Proxy configuration for the DPU. When set, containerd on the DPU routes outbound HTTPS traffic through it. |
510+
| `deployments` | `DpfDeploymentsConfig` | *(default)* | Per-generation DPUDeployment configurations. BF3 is always present with defaults; BF4Generic is opt-in via `[dpf.deployments.bf4_generic]`. |
511511
### `RmsConfig`
512512

513513
| Field | Type | Default | Description |
@@ -534,7 +534,10 @@ Extends `StateControllerConfig` with:
534534
| `token_ttl_min_sec` | `u32` | `60` | Minimum token TTL in seconds. |
535535
| `token_ttl_max_sec` | `u32` | `86400` | Maximum token TTL in seconds. |
536536
| `token_endpoint_http_proxy` | `Option<String>` || HTTP proxy for token endpoint calls (SSRF mitigation). |
537-
537+
| `current_encryption_key_id` | `Option<String>` || Key-id for encrypting new tenant identity ciphertext (selects from the `machine_identity.encryption_keys` secrets). |
538+
| `trust_domain_allowlist` | `Vec<String>` | `[]` | Trust domains allowed for tenant JWT `iss` (normalized host). Empty allows any. Patterns: exact hostname, `*.suffix` (one label under suffix), `**.suffix` (suffix or any subdomain). |
539+
| `token_endpoint_domain_allowlist` | `Vec<String>` | `[]` | Allowed DNS names for the `token_endpoint` URL host (`http://` / `https://` only). Empty allows any; same pattern syntax as `trust_domain_allowlist`. |
540+
| `signing_key_overlap_max_sec` | `u32` | `604800` | Upper bound for `signing_key_overlap_sec` on `SetTenantIdentityConfiguration` when `rotate_key` is true (seconds). |
538541
### `MeasuredBootMetricsCollectorConfig`
539542

540543
| Field | Type | Default | Description |

crates/api-core/src/test_support/default_config.rs

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,54 @@ use model::resource_pool::{self};
3838
use regex::Regex;
3939

4040
use crate::cfg::file::{
41-
CarbideConfig, DpaConfig, DpaInterfaceStateControllerConfig, DpuConfig as InitialDpuConfig,
42-
IbPartitionStateControllerConfig, ListenMode, MachineUpdater,
41+
AuthConfig, CarbideConfig, DpaConfig, DpaInterfaceStateControllerConfig,
42+
DpuConfig as InitialDpuConfig, DsxExchangeEventBusConfig, FnnConfig,
43+
IbPartitionStateControllerConfig, KmsConfig, ListenMode, MachineUpdater,
4344
MeasuredBootMetricsCollectorConfig, MqttAuthConfig, NetworkSecurityGroupConfig,
4445
NetworkSegmentStateControllerConfig, PowerShelfStateControllerConfig,
45-
RackStateControllerConfig, SpdmConfig, SpdmStateControllerConfig, SwitchStateControllerConfig,
46-
TracingConfig, VmaasConfig, VpcPeeringPolicy, VpcPrefixStateControllerConfig,
47-
default_bmc_session_lockout_threshold, default_max_find_by_ids, default_pxe_public_base_url,
46+
RackStateControllerConfig, SecretsConfig, SpdmConfig, SpdmStateControllerConfig,
47+
SwitchStateControllerConfig, TracingConfig, VmaasConfig, VpcPeeringPolicy,
48+
VpcPrefixStateControllerConfig, default_bmc_session_lockout_threshold, default_max_find_by_ids,
49+
default_pxe_public_base_url,
4850
};
4951

52+
/// [`get`] with every `Option` config section populated. Used by tests that
53+
/// walk the *serialized* config shape — e.g. the admin-UI documentation
54+
/// guards, which can only verify sections that actually serialize. When a
55+
/// new `Option` section is added to [`CarbideConfig`] (the compiler forces
56+
/// it into [`get`]), populate it here too so those guards can see inside it.
57+
pub fn fully_populated() -> CarbideConfig {
58+
CarbideConfig {
59+
auth: Some(AuthConfig {
60+
permissive_mode: true,
61+
casbin_policy_file: None,
62+
cli_certs: None,
63+
trust: None,
64+
}),
65+
ib_config: Some(carbide_ib_fabric::config::IBFabricConfig::default()),
66+
fnn: Some(FnnConfig {
67+
admin_vpc: None,
68+
common_internal_route_target: None,
69+
additional_route_target_imports: vec![],
70+
routing_profiles: HashMap::new(),
71+
use_vpc_vrf_loopback: false,
72+
}),
73+
dsx_exchange_event_bus: Some(DsxExchangeEventBusConfig::default()),
74+
secrets: Some(SecretsConfig {
75+
kms: KmsConfig {
76+
active: "local".to_string(),
77+
providers: HashMap::new(),
78+
},
79+
routing: HashMap::from([("/".to_string(), "kek".to_string())]),
80+
backends: vec![],
81+
writer: Default::default(),
82+
import_from: None,
83+
import_approach: Default::default(),
84+
}),
85+
..get()
86+
}
87+
}
88+
5089
pub fn get() -> CarbideConfig {
5190
CarbideConfig {
5291
default_tenant_routing_profile_type: "EXTERNAL".to_string(),

crates/api-web/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ carbide-sqlx-testing = { path = "../sqlx-testing", default-features = false }
109109
carbide-test-harness = { path = "../test-harness" }
110110
carbide-test-support = { path = "../test-support" }
111111
http-body-util = { workspace = true }
112-
toml = { workspace = true }
113112
sqlx = { workspace = true, features = [
114113
"runtime-tokio",
115114
"tls-rustls",

0 commit comments

Comments
 (0)