moomman commented on code in PR #286:
URL:
https://github.com/apache/shardingsphere-on-cloud/pull/286#discussion_r1156672370
##########
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"
+)
// ShardingSphereChaosStatus defines the actual state of ShardingSphereChaos
-type ShardingSphereChaosStatus struct{}
+type ShardingSphereChaosStatus struct {
+ ChaosCondition DeploymentCondition `json:"deploymentCondition"`
+ InjectStatus Jobschedule `json:"InjectStatus"`
+ VerifyStatus Jobschedule `json:"VerifyStatus"`
+}
+
+// pod chaos
+
+type PodChaosAction string
+
+var (
+ PodFailureAction PodChaosAction = "podFailure"
Review Comment:
maybe the `containerkill` which next to it should be lower case
--
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]