Skip to content

Commit 437d413

Browse files
committed
refactor: improve comments in ModuleTemplate and Workspace API types for clarity
- Enhanced comments in ModuleTemplateStatus and WorkspaceSpec to provide clearer descriptions of fields and their purposes. - Updated terminology in comments to ensure consistency and better understanding of the API structure.
1 parent 677b388 commit 437d413

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

addons/v1alpha1/moduletemplate_types.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ type ModuleTemplateSpec struct {
6868
Kustomization *KustomizationTemplateSpec `json:"kustomization,omitempty"`
6969
}
7070

71-
// ModuleTemplateStatus defines the observed state of the ModuleTemplate.
71+
// ModuleTemplateStatus defines the observed state of a ModuleTemplate.
72+
// It tracks whether the template has been validated and is ready for use.
7273
type ModuleTemplateStatus struct {
7374
// ObservedGeneration is the most recent generation observed by the controller.
75+
// It corresponds to the ModuleTemplate's generation, which is updated on mutation by the API Server.
7476
// +optional
7577
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
7678

77-
// Conditions store the status conditions of the ModuleTemplate.
79+
// Conditions store the status conditions of the ModuleTemplate (e.g., Ready).
7880
// +listType=map
7981
// +listMapKey=type
8082
// +optional
@@ -99,7 +101,7 @@ type ModuleTemplate struct {
99101
// +optional
100102
metav1.ObjectMeta `json:"metadata,omitzero"`
101103

102-
// Spec defines the module template blueprint.
104+
// Spec defines the desired behavior of the ModuleTemplate.
103105
// +required
104106
Spec ModuleTemplateSpec `json:"spec"`
105107

tenant/v1alpha1/workspace_types.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ type WorkspaceSpec struct {
9797
// +required
9898
Members []WorkspaceMember `json:"members"`
9999

100-
// ResourceQuota describes the compute resource constraints (CPU, Memory, etc.) applied to the underlying namespace.
100+
// ResourceQuota defines the compute resource constraints (CPU, Memory, etc.) applied to the underlying namespace.
101101
// The actual schema is composed at runtime by the Schema RPC from the core/v1 ResourceQuota.
102102
// +kubebuilder:pruning:PreserveUnknownFields
103103
// +optional
104104
ResourceQuota *runtime.RawExtension `json:"resourceQuota,omitempty"`
105105

106-
// LimitRange describes the default resource limits and requests for pods in the workspace.
106+
// LimitRange defines the default resource limits and requests for pods in the workspace.
107107
// The actual schema is composed at runtime by the Schema RPC from the core/v1 LimitRange.
108108
// +kubebuilder:pruning:PreserveUnknownFields
109109
// +optional
@@ -115,8 +115,6 @@ type WorkspaceSpec struct {
115115
}
116116

117117
// ResourceReference is a lightweight reference to a Kubernetes resource managed by the operator.
118-
// Unlike corev1.ObjectReference, it only contains the essential fields needed
119-
// to identify the resource, avoiding stale UID/ResourceVersion issues.
120118
type ResourceReference struct {
121119
// Name is the name of the referenced resource.
122120
// +required

0 commit comments

Comments
 (0)