This is an automated email from the ASF dual-hosted git repository.

jimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-seata-k8s.git


The following commit(s) were added to refs/heads/master by this push:
     new 8af543d  optimize: fix kubebuilder status generate (#40)
8af543d is described below

commit 8af543dbea5ae9d48745f755b0a72427e7ae3f55
Author: jimin <[email protected]>
AuthorDate: Mon Nov 24 10:16:09 2025 +0800

    optimize: fix kubebuilder status generate (#40)
---
 api/v1/seataserver_types.go       | 28 ++++++++++++++++++++++------
 api/v1alpha1/seataserver_types.go | 28 ++++++++++++++++++++++------
 2 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/api/v1/seataserver_types.go b/api/v1/seataserver_types.go
index 4db1cd8..dfeb008 100644
--- a/api/v1/seataserver_types.go
+++ b/api/v1/seataserver_types.go
@@ -92,17 +92,33 @@ func (e ServerErrorType) String() string {
 
 // SeataServerError defines the error of SeataServer
 type SeataServerError struct {
-       Type      string      `json:"type"`
-       Message   string      `json:"message"`
+       // Type describes the category of the error
+       // +kubebuilder:validation:Optional
+       Type string `json:"type"`
+       // Message contains the error message details
+       // +kubebuilder:validation:Optional
+       Message string `json:"message"`
+       // Timestamp is when the error occurred
+       // +kubebuilder:validation:Optional
        Timestamp metav1.Time `json:"timestamp"`
 }
 
 // SeataServerStatus defines the observed state of SeataServer
 type SeataServerStatus struct {
-       Synchronized  bool               `json:"synchronized"`
-       Replicas      int32              `json:"replicas"`
-       ReadyReplicas int32              `json:"readyReplicas,omitempty"`
-       Errors        []SeataServerError `json:"errors,omitempty"`
+       // Synchronized indicates whether the raft cluster is fully synchronized
+       // +kubebuilder:validation:Optional
+       Synchronized bool `json:"synchronized"`
+       // Replicas is the desired number of replicas
+       // +kubebuilder:validation:Optional
+       Replicas int32 `json:"replicas"`
+       // ReadyReplicas is the number of ready replicas
+       // +kubebuilder:validation:Optional
+       ReadyReplicas int32 `json:"readyReplicas,omitempty"`
+       // Errors contains recent reconciliation errors (up to 5 most recent)
+       // +kubebuilder:validation:Optional
+       // +patchMergeKey=timestamp
+       // +patchStrategy=merge
+       Errors []SeataServerError `json:"errors,omitempty" 
patchStrategy:"merge" patchMergeKey:"timestamp"`
 }
 
 //+kubebuilder:object:root=true
diff --git a/api/v1alpha1/seataserver_types.go 
b/api/v1alpha1/seataserver_types.go
index a374df1..ab2401f 100644
--- a/api/v1alpha1/seataserver_types.go
+++ b/api/v1alpha1/seataserver_types.go
@@ -92,17 +92,33 @@ func (e ServerErrorType) String() string {
 
 // SeataServerError defines the error of SeataServer
 type SeataServerError struct {
-       Type      string      `json:"type"`
-       Message   string      `json:"message"`
+       // Type describes the category of the error
+       // +kubebuilder:validation:Optional
+       Type string `json:"type"`
+       // Message contains the error message details
+       // +kubebuilder:validation:Optional
+       Message string `json:"message"`
+       // Timestamp is when the error occurred
+       // +kubebuilder:validation:Optional
        Timestamp metav1.Time `json:"timestamp"`
 }
 
 // SeataServerStatus defines the observed state of SeataServer
 type SeataServerStatus struct {
-       Synchronized  bool               `json:"synchronized"`
-       Replicas      int32              `json:"replicas"`
-       ReadyReplicas int32              `json:"readyReplicas,omitempty"`
-       Errors        []SeataServerError `json:"errors,omitempty"`
+       // Synchronized indicates whether the raft cluster is fully synchronized
+       // +kubebuilder:validation:Optional
+       Synchronized bool `json:"synchronized"`
+       // Replicas is the desired number of replicas
+       // +kubebuilder:validation:Optional
+       Replicas int32 `json:"replicas"`
+       // ReadyReplicas is the number of ready replicas
+       // +kubebuilder:validation:Optional
+       ReadyReplicas int32 `json:"readyReplicas,omitempty"`
+       // Errors contains recent reconciliation errors (up to 5 most recent)
+       // +kubebuilder:validation:Optional
+       // +patchMergeKey=timestamp
+       // +patchStrategy=merge
+       Errors []SeataServerError `json:"errors,omitempty" 
patchStrategy:"merge" patchMergeKey:"timestamp"`
 }
 
 //+kubebuilder:object:root=true


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to