Skip to content

Commit da24b11

Browse files
Merge pull request #81 from numtide/api-spec-doc-comments
api: add documentation comments to exported fields
2 parents 5b96bd5 + 4b985d9 commit da24b11

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

api/v1alpha1/cell_types.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ type CellSpec struct {
7171

7272
// TopologyReconciliation defines flags for the cell controller.
7373
type TopologyReconciliation struct {
74+
// RegisterCell indicates if the cell should register itself in the topology.
7475
RegisterCell bool `json:"registerCell"`
76+
77+
// PrunePoolers indicates if unused poolers should be removed.
7578
PrunePoolers bool `json:"prunePoolers"`
7679
}
7780

@@ -85,8 +88,13 @@ type CellStatus struct {
8588
// +optional
8689
Conditions []metav1.Condition `json:"conditions,omitempty"`
8790

88-
GatewayReplicas int32 `json:"gatewayReplicas"`
91+
// GatewayReplicas is the total number of gateway pods.
92+
GatewayReplicas int32 `json:"gatewayReplicas"`
93+
94+
// GatewayReadyReplicas is the number of gateway pods that are ready.
8995
GatewayReadyReplicas int32 `json:"gatewayReadyReplicas"`
96+
97+
// GatewayServiceName is the DNS name of the gateway service.
9098
// +kubebuilder:validation:MaxLength=253
9199
GatewayServiceName string `json:"gatewayServiceName,omitempty"`
92100
}

api/v1alpha1/shard_types.go

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,34 +83,44 @@ type PoolSpec struct {
8383

8484
// ShardSpec defines the desired state of Shard.
8585
type ShardSpec struct {
86+
// DatabaseName is the name of the logical database this shard belongs to.
8687
// +kubebuilder:validation:MaxLength=63
8788
DatabaseName string `json:"databaseName"`
89+
90+
// TableGroupName is the name of the table group this shard belongs to.
8891
// +kubebuilder:validation:MaxLength=63
8992
TableGroupName string `json:"tableGroupName"`
93+
94+
// ShardName is the specific identifier for this shard (e.g. "0").
9095
// +kubebuilder:validation:MaxLength=63
9196
ShardName string `json:"shardName"`
9297

93-
// Images required.
98+
// Images defines the container images to be used by this shard (defined globally at MultigresCluster).
9499
Images ShardImages `json:"images"`
95100

96-
// GlobalTopoServer reference.
101+
// GlobalTopoServer is a reference to the global topology server.
97102
GlobalTopoServer GlobalTopoServerRef `json:"globalTopoServer"`
98103

99-
// MultiOrch fully resolved spec.
104+
// MultiOrch is the fully resolved configuration for the shard orchestrator.
100105
MultiOrch MultiOrchSpec `json:"multiorch"`
101106

102-
// Pools fully resolved spec.
107+
// Pools is the map of fully resolved data pool configurations.
103108
// +kubebuilder:validation:MaxProperties=32
104109
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
105110
Pools map[string]PoolSpec `json:"pools"`
106111
}
107112

108113
// ShardImages defines the images required for a Shard.
109114
type ShardImages struct {
115+
// MultiOrch is the image for the shard orchestrator.
110116
// +kubebuilder:validation:MaxLength=512
111117
MultiOrch string `json:"multiorch"`
118+
119+
// MultiPooler is the image for the connection pooler sidecar.
112120
// +kubebuilder:validation:MaxLength=512
113121
MultiPooler string `json:"multipooler"`
122+
123+
// Postgres is the image for the postgres database.
114124
// +kubebuilder:validation:MaxLength=512
115125
Postgres string `json:"postgres"`
116126
}
@@ -130,7 +140,10 @@ type ShardStatus struct {
130140
// +kubebuilder:validation:MaxItems=100
131141
Cells []CellName `json:"cells,omitempty"`
132142

133-
OrchReady bool `json:"orchReady"`
143+
// OrchReady indicates if the MultiOrch component is ready.
144+
OrchReady bool `json:"orchReady"`
145+
146+
// PoolsReady indicates if all data pools are ready.
134147
PoolsReady bool `json:"poolsReady"`
135148
}
136149

api/v1alpha1/tablegroup_types.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,22 @@ import (
2929

3030
// TableGroupSpec defines the desired state of TableGroup.
3131
type TableGroupSpec struct {
32+
// DatabaseName is the name of the logical database.
3233
// +kubebuilder:validation:MaxLength=63
3334
DatabaseName string `json:"databaseName"`
35+
36+
// TableGroupName is the name of this table group.
3437
// +kubebuilder:validation:MaxLength=63
3538
TableGroupName string `json:"tableGroupName"`
3639

3740
// IsDefault indicates if this is the default/unsharded group for the database.
3841
// +optional
3942
IsDefault bool `json:"default,omitempty"`
4043

41-
// Images required for child shards.
44+
// Images defines the container images used for child shards - defined globally in MultigresCluster.
4245
Images ShardImages `json:"images"`
4346

44-
// GlobalTopoServer reference.
47+
// GlobalTopoServer is a reference to the global topology server.
4548
GlobalTopoServer GlobalTopoServerRef `json:"globalTopoServer"`
4649

4750
// Shards is the list of FULLY RESOLVED shard specifications.
@@ -52,13 +55,14 @@ type TableGroupSpec struct {
5255
// ShardResolvedSpec represents the fully calculated spec for a shard,
5356
// pushed down to the TableGroup.
5457
type ShardResolvedSpec struct {
58+
// Name is the identifier of the shard.
5559
// +kubebuilder:validation:MaxLength=63
5660
Name string `json:"name"`
5761

58-
// MultiOrch fully resolved spec.
62+
// MultiOrch is the fully resolved configuration for the orchestrator.
5963
MultiOrch MultiOrchSpec `json:"multiorch"`
6064

61-
// Pools fully resolved spec.
65+
// Pools is the map of fully resolved data pool configurations.
6266
// +kubebuilder:validation:MaxProperties=32
6367
// +kubebuilder:validation:XValidation:rule="self.all(key, size(key) < 63)",message="pool names must be < 63 chars"
6468
Pools map[string]PoolSpec `json:"pools"`

api/v1alpha1/toposerver_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,17 @@ type LocalTopoServerSpec struct {
141141
// GlobalTopoServerRef defines a reference to the global topo server.
142142
// Used by Cell, TableGroup, and Shard.
143143
type GlobalTopoServerRef struct {
144+
// Address is the DNS address of the topology server.
144145
// +kubebuilder:validation:MinLength=1
145146
// +kubebuilder:validation:MaxLength=512
146147
Address string `json:"address"`
148+
149+
// RootPath is the etcd prefix for this cluster.
147150
// +kubebuilder:validation:MinLength=1
148151
// +kubebuilder:validation:MaxLength=512
149152
RootPath string `json:"rootPath"`
153+
154+
// Implementation defines the client implementation (e.g. "etcd").
150155
// +kubebuilder:validation:MinLength=1
151156
// +kubebuilder:validation:MaxLength=63
152157
Implementation string `json:"implementation"`

0 commit comments

Comments
 (0)