mlycore commented on code in PR #293:
URL: 
https://github.com/apache/shardingsphere-on-cloud/pull/293#discussion_r1164911903


##########
shardingsphere-operator/api/v1alpha1/storage_node_types.go:
##########
@@ -17,7 +17,65 @@
 
 package v1alpha1
 
-import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+import (
+       corev1 "k8s.io/api/core/v1"
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type StorageNodePhaseStatus string
+
+const (
+       StorageNodePhaseReady    StorageNodePhaseStatus = "Ready"
+       StorageNodePhaseNotReady StorageNodePhaseStatus = "NotReady"
+)
+
+type StorageNodeConditionType string
+
+// StorageNodeConditionType shows some states during the startup process of 
storage node
+const (
+       StorageNodeConditionTypeAvailable StorageNodeConditionType = "Available"

Review Comment:
   Please add explanation for these two conditions and update related design 
proposal.



##########
shardingsphere-operator/api/v1alpha1/storage_node_types.go:
##########
@@ -17,7 +17,65 @@
 
 package v1alpha1
 
-import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+import (
+       corev1 "k8s.io/api/core/v1"
+       metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+type StorageNodePhaseStatus string
+
+const (
+       StorageNodePhaseReady    StorageNodePhaseStatus = "Ready"
+       StorageNodePhaseNotReady StorageNodePhaseStatus = "NotReady"
+)
+
+type StorageNodeConditionType string
+
+// StorageNodeConditionType shows some states during the startup process of 
storage node
+const (
+       StorageNodeConditionTypeAvailable StorageNodeConditionType = "Available"
+       StorageNodeConditionTypeDegraded  StorageNodeConditionType = "Degraded"
+)
+
+type StorageNodeConditions []*StorageNodeCondition
+
+// StorageNodeCondition contains details for the current condition of this 
StorageNode.
+type StorageNodeCondition struct {
+       Type           StorageNodeConditionType `json:"type"`
+       Status         corev1.ConditionStatus   `json:"status"`
+       LastUpdateTime metav1.Time              
`json:"lastUpdateTime,omitempty"`
+       Reason         string                   `json:"reason"`
+       Message        string                   `json:"message"`
+}
+
+// ClusterStatus is the status of a database cluster, including the primary 
endpoint, reader endpoints, and other properties.
+// Properties are some additional information about the cluster, like 'arn, 
identifier, credentials, etc.'
+type ClusterStatus struct {
+       Status          string            `json:"status"`
+       PrimaryEndpoint Endpoint          `json:"primaryEndpoint"`
+       ReaderEndpoints []Endpoint        `json:"readerEndpoints"`
+       Properties      map[string]string `json:"properties"`
+}
+
+type CredentialType struct {
+       BasicCredential `json:"basic_credential"`
+}
+
+type InstanceStatus struct {
+       Status     string            `json:"status"`
+       Endpoint   Endpoint          `json:"primaryEndpoint"`
+       Properties map[string]string `json:"properties"`
+}
+
+type BasicCredential struct {
+       Username string `json:"user"`

Review Comment:
   For better maintainability, please tag the object member with same name.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to