Skip to content

Commit

Permalink
refactor: rename ShardingSphereChaos to Chaos
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Jun 7, 2023
1 parent e8bdd1a commit 56ec1a9
Show file tree
Hide file tree
Showing 7 changed files with 180 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ import (
)

// +kubebuilder:object:root=true
// ShardingSphereChaosList contains a list of ShardingSphereChaos
type ShardingSphereChaosList struct {
// ChaosList contains a list of Chaos
type ChaosList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ShardingSphereChaos `json:"items"`
Items []Chaos `json:"items"`
}

// +kubebuilder:printcolumn:JSONPath=".metadata.creationTimestamp",name=Age,type=date
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// ShardingSphereChaos defines a chaos test case for the ShardingSphere Proxy cluster
type ShardingSphereChaos struct {
// Chaos defines a chaos test case for the ShardingSphere Proxy cluster
type Chaos struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ShardingSphereChaosSpec `json:"spec,omitempty"`
Status ShardingSphereChaosStatus `json:"status,omitempty"`
Spec ChaosSpec `json:"spec,omitempty"`
Status ChaosStatus `json:"status,omitempty"`
}

// ShardingSphereChaosSpec defines the desired state of ShardingSphereChaos
type ShardingSphereChaosSpec struct {
InjectJob JobSpec `json:"injectJob,omitempty"`
EmbedChaos `json:",inline"`
// ChaosSpec defines the desired state of Chaos
type ChaosSpec struct {
EmbedChaos `json:",inline"`

InjectJob JobSpec `json:"injectJob,omitempty"`
PressureCfg PressureCfg `json:"pressureCfg"`
}

Expand Down Expand Up @@ -92,15 +93,15 @@ const (
Unknown ChaosCondition = "Unknown"
)

// ShardingSphereChaosStatus defines the actual state of ShardingSphereChaos
type ShardingSphereChaosStatus struct {
// ChaosStatus defines the actual state of Chaos
type ChaosStatus struct {
ChaosCondition ChaosCondition `json:"chaosCondition"`
Phase ChaosPhase `json:"phase"`
Result Result `json:"result"`
Conditions []*metav1.Condition `json:"condition,omitempty"`
}

// Result represents the result of the ShardingSphereChaos
// Result represents the result of the Chaos
type Result struct {
Steady Msg `json:"steady"`
Chaos Msg `json:"chaos"`
Expand Down Expand Up @@ -168,7 +169,6 @@ type NetworkChaosSpec struct {

// +optional
Action NetworkChaosAction `json:"action"`

// +optional
Duration *string `json:"duration,omitempty"`
// +optional
Expand Down Expand Up @@ -250,5 +250,5 @@ type PodSelector struct {
}

func init() {
SchemeBuilder.Register(&ShardingSphereChaos{}, &ShardingSphereChaosList{})
SchemeBuilder.Register(&Chaos{}, &ChaosList{})
}
Loading

0 comments on commit 56ec1a9

Please sign in to comment.