mlycore commented on code in PR #303:
URL:
https://github.com/apache/shardingsphere-on-cloud/pull/303#discussion_r1165179194
##########
shardingsphere-operator/api/v1alpha1/shardingsphere_chaos_types.go:
##########
@@ -34,14 +36,201 @@ type ShardingSphereChaosList struct {
type ShardingSphereChaos struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
+ Spec ShardingSphereChaosSpec `json:"spec,omitempty"`
+ Status ShardingSphereChaosStatus `json:"status,omitempty"`
+}
- Spec ShardingSphereChaosSpec `json:"spec,omitempty"`
+// ShardingSphereChaosSpec defines the desired state of ShardingSphereChaos
+type ShardingSphereChaosSpec struct {
+ InjectJob JobSpec `json:"injectJob,omitempty"`
+ ChaosKind ChaosKind `json:"chaosKind,omitempty"`
Review Comment:
Consider remove this `ChaosKind` and we have already make it explicit in
`EmbedChaos`
##########
shardingsphere-operator/pkg/controllers/shardingsphere_chaos_controller.go:
##########
@@ -19,31 +19,301 @@ package controllers
import (
"context"
+ "time"
-
"github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/api/v1alpha1"
+
"github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/kubernetes/configmap"
+ v1 "k8s.io/api/core/v1"
+
+ sschaosv1alpha1
"github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/api/v1alpha1"
+
"github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/kubernetes/chaos"
+
"github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/kubernetes/job"
+ reconcile
"github.com/apache/shardingsphere-on-cloud/shardingsphere-operator/pkg/reconcile/shardingspherechaos"
+ chaosv1alpha1 "github.com/chaos-mesh/chaos-mesh/api/v1alpha1"
"github.com/go-logr/logr"
+ batchV1 "k8s.io/api/batch/v1"
+ apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
)
+const (
+ ShardingSphereChaosControllerName = "shardingSphereChaos-controller"
Review Comment:
Rename it to `shardingsphere-chaos-controller` keep it simple to read
--
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]