Skip to main content

orchestrator_client/
config.rs

1use serde::{Deserialize, Serialize};
2
3/// Control-plane configuration file generated by the daemon and consumed
4/// by clients (CLI, GUI).  Follows a kubeconfig-shaped YAML layout.
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct ControlPlaneConfig {
7    /// Name of the currently selected context.
8    pub current_context: String,
9    /// Cluster entries available in the bundle.
10    pub clusters: Vec<NamedCluster>,
11    /// User entries available in the bundle.
12    pub users: Vec<NamedUser>,
13    /// Context entries available in the bundle.
14    pub contexts: Vec<NamedContext>,
15}
16
17/// Named cluster entry inside a generated control-plane config file.
18#[derive(Debug, Clone, Serialize, Deserialize)]
19pub struct NamedCluster {
20    /// Cluster entry name.
21    pub name: String,
22    /// Cluster reference payload.
23    pub cluster: ClusterRef,
24}
25
26/// Server endpoint and CA bundle reference for a named cluster entry.
27#[derive(Debug, Clone, Serialize, Deserialize)]
28pub struct ClusterRef {
29    /// Server URL for the control-plane endpoint.
30    pub server: String,
31    /// Path to the CA bundle file.
32    pub certificate_authority: String,
33}
34
35/// Named user entry inside a generated control-plane config file.
36#[derive(Debug, Clone, Serialize, Deserialize)]
37pub struct NamedUser {
38    /// User entry name.
39    pub name: String,
40    /// User reference payload.
41    pub user: UserRef,
42}
43
44/// Client certificate and key locations for a named user entry.
45#[derive(Debug, Clone, Serialize, Deserialize)]
46pub struct UserRef {
47    /// Path to the client certificate file.
48    pub client_certificate: String,
49    /// Path to the client private-key file.
50    pub client_key: String,
51}
52
53/// Named context entry that binds a cluster and user together.
54#[derive(Debug, Clone, Serialize, Deserialize)]
55pub struct NamedContext {
56    /// Context entry name.
57    pub name: String,
58    /// Context reference payload.
59    pub context: ContextRef,
60}
61
62/// Cluster and user references selected by a named context entry.
63#[derive(Debug, Clone, Serialize, Deserialize)]
64pub struct ContextRef {
65    /// Cluster name selected by the context.
66    pub cluster: String,
67    /// User name selected by the context.
68    pub user: String,
69}