moomman commented on code in PR #286:
URL:
https://github.com/apache/shardingsphere-on-cloud/pull/286#discussion_r1156666957
##########
shardingsphere-operator/api/v1alpha1/shardingsphere_chaos_types.go:
##########
@@ -36,12 +38,202 @@ type ShardingSphereChaos struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ShardingSphereChaosSpec `json:"spec,omitempty"`
- // +optional
+
Status ShardingSphereChaosStatus `json:"status,omitempty"`
}
// ShardingSphereChaosSpec defines the desired state of ShardingSphereChaos
-type ShardingSphereChaosSpec struct{}
+type ShardingSphereChaosSpec struct {
+ //InjectJob batchV1Beta1.JobTemplateSpec `json:"InjectJob,omitempty"`
+
+ ChaosKind ChaosKind `json:"chaosKind,omitempty"`
+
+ EmbedChaos `json:",inline"`
+
+ //Verify batchV1Beta1.JobTemplateSpec `json:"Verify,omitempty"`
+}
+
+type ChaosKind string
+
+const (
+ NetworkChaosKind ChaosKind = "networkChaos"
+
+ PodChaosKind ChaosKind = "podChaos"
+)
+
+type EmbedChaos struct {
+ // +optional
+ NetworkChaos *NetworkChaosSpec `json:"networkChaos,omitempty"`
+ // +optional
+ PodChaos *PodChaosSpec `json:"podChaos,omitempty"`
+}
+
+type DeploymentCondition string
+
+const (
+ Creating DeploymentCondition = "Creating"
+ AllRecovered DeploymentCondition = "AllRecovered"
+ Paused DeploymentCondition = "Paused"
+ AllInjected DeploymentCondition = "AllInjected"
+)
+
+type Jobschedule string
+
+const (
+ JobCreating Jobschedule = "JobCreating"
+ JobFailed Jobschedule = "JobFailed"
+ JobFinish Jobschedule = "JobFinish"
Review Comment:
sure,it is more complex than kubernetes Job status,maybe check job status in
reconcile directly is better?
It will be changed in commit later
--
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]