From 5286584f744f95da9e75446c19e02a7627ea4abe Mon Sep 17 00:00:00 2001 From: "wenkun.zwk" Date: Tue, 14 May 2024 18:02:41 +0800 Subject: [PATCH 1/4] feature: autoselect install way --- chaosmeta-inject-operator/main.go | 31 +++++++++---------- .../middlewareexecutor/middlewareexecutor.go | 4 +++ .../middlewareexecutor/tse/tsemiddleware.go | 10 +++++- .../executor/remoteexecutor/remoteexecutor.go | 4 ++- .../pkg/phasehandler/inject/handler.go | 5 +-- .../pkg/phasehandler/recover/handler.go | 4 +-- 6 files changed, 35 insertions(+), 23 deletions(-) diff --git a/chaosmeta-inject-operator/main.go b/chaosmeta-inject-operator/main.go index 0a5cd99..a7e986f 100644 --- a/chaosmeta-inject-operator/main.go +++ b/chaosmeta-inject-operator/main.go @@ -73,8 +73,8 @@ func main() { var enableLeaderElection bool var probeAddr string //flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.") - flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") - flag.BoolVar(&enableLeaderElection, "leader-elect", false, + flag.StringVar(&probeAddr, "health-probe-bind-address", ":8083", "The address the probe endpoint binds to.") + flag.BoolVar(&enableLeaderElection, "leader-elect", true, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") opts := zap.Options{ @@ -85,13 +85,20 @@ func main() { ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) + err := global.InitKubernetesClient() + if err != nil { + setupLog.Error(err, "init global client fail") + os.Exit(1) + } + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, //MetricsBindAddress: metricsAddr, - Port: 9443, - HealthProbeBindAddress: probeAddr, - LeaderElection: enableLeaderElection, - LeaderElectionID: "9cb44693.chaosmeta.io", + Port: 9443, + HealthProbeBindAddress: probeAddr, + LeaderElection: enableLeaderElection, + LeaderElectionID: "9cb44693.chaosmeta.io", + LeaderElectionNamespace: "chaosmeta", // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily // when the Manager ends. This requires the binary to immediately end when the // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly @@ -141,23 +148,13 @@ func main() { setupLog.Error(err, "set APIServer client error") os.Exit(1) } - setupLog.Info(fmt.Sprintf("set APIServer for cloud object success: %v", t)) + err = initwebhook.InitCert(setupLog, ComponentInject) if err != nil { setupLog.Error(err, "init cert failed") os.Exit(1) } - // set executor - //if err = remoteexecutor.SetGlobalRemoteExecutor(&mainConfig.Executor, mgr.GetConfig(), mgr.GetScheme()); err != nil { - // setupLog.Error(err, "set remote executor error") - // os.Exit(1) - //} - err = global.InitKubernetesClient() - if err != nil { - setupLog.Error(err, "init global client fail") - os.Exit(1) - } // start watching if err = (&controllers.ExperimentReconciler{ Client: mgr.GetClient(), diff --git a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/middlewareexecutor.go b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/middlewareexecutor.go index 8ca6957..5ba6f05 100644 --- a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/middlewareexecutor.go +++ b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/middlewareexecutor.go @@ -7,6 +7,7 @@ import ( "github.com/traas-stack/chaosmeta/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/common" "github.com/traas-stack/chaosmeta/chaosmeta-inject-operator/pkg/model" "os" + "sigs.k8s.io/controller-runtime/pkg/log" "strings" ) @@ -31,9 +32,12 @@ type MiddleWareExecutor struct { func (r *MiddleWareExecutor) CheckExecutorWay(ctx context.Context) error { // 对本机执行一次查询 + logger := log.FromContext(ctx) checkCmd := "ls" host := os.Getenv("LOCAL_IP") + logger.Info("hostip", "ip: ", host) res := r.Middleware.ExecCmdTask(ctx, host, checkCmd) + logger.Info("CheckExecutorWay", "res", res) if !res.Success { return fmt.Errorf(res.Message) } diff --git a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/tsemiddleware.go b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/tsemiddleware.go index be279a9..5a8ec6b 100644 --- a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/tsemiddleware.go +++ b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/tsemiddleware.go @@ -51,6 +51,7 @@ func (r *TseMiddleware) ExecCmdTask(ctx context.Context, host string, cmd string Success: false, Message: "fail to exec", } + fmt.Println("ExecCmdTask") requestBody := &TseTaskRequest{} requestBody.Ip = host requestBody.Exeurl = cmdPrefix + cmd @@ -59,19 +60,25 @@ func (r *TseMiddleware) ExecCmdTask(ctx context.Context, host string, cmd string requestBody.Key = ak requestBody.User = "root" requestBody.Sign = hmacSha1(requestBody, sk) + fmt.Println("RequestBody", requestBody) requestBodyStr, err := json.Marshal(requestBody) if err != nil { + errResult.Message = err.Error() return errResult } execTaskUrl := fmt.Sprintf("%s/api/task", r.TseUrl) req, err := http.NewRequest("POST", execTaskUrl, bytes.NewBuffer(requestBodyStr)) if err != nil { + fmt.Println(err) + errResult.Message = err.Error() return errResult } client := &http.Client{} req.Header.Set("Content-Type", "application/json") resp, err := client.Do(req) if err != nil { + fmt.Println(err) + errResult.Message = err.Error() return errResult } result := &common.TaskResult{} @@ -82,9 +89,10 @@ func (r *TseMiddleware) ExecCmdTask(ctx context.Context, host string, cmd string } err = json.Unmarshal(body, result) if err != nil { + errResult.Message = err.Error() return errResult } - return common.TaskResult{} + return *result } func hmacSha1(tseTaskRequest *TseTaskRequest, key string) string { diff --git a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go index 51020cc..864f240 100644 --- a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go +++ b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go @@ -74,7 +74,6 @@ func AutoSelectRemoteExecutor(ctx context.Context, config *config.ExecutorConfig DaemonsetLabel: config.DaemonsetConfig.DaemonLabel, DaemonsetName: config.DaemonsetConfig.DaemonName, } - //logger.Info("%v", config) if err := daemonSetRemoteExecutor.CheckExecutorWay(ctx); err == nil { globalRemoteExecutor = daemonSetRemoteExecutor logger.Info("select daemonSet way") @@ -96,6 +95,9 @@ func AutoSelectRemoteExecutor(ctx context.Context, config *config.ExecutorConfig logger.Info("select middleware way") globalRemoteExecutor = middlewareRemoteExecutor return nil + } else { + globalRemoteExecutor = middlewareRemoteExecutor + logger.Error(err, "fail to check middleware way") } agentExecutor := &agentexecutor.AgentRemoteExecutor{ diff --git a/chaosmeta-inject-operator/pkg/phasehandler/inject/handler.go b/chaosmeta-inject-operator/pkg/phasehandler/inject/handler.go index a962c72..17a5c07 100644 --- a/chaosmeta-inject-operator/pkg/phasehandler/inject/handler.go +++ b/chaosmeta-inject-operator/pkg/phasehandler/inject/handler.go @@ -234,11 +234,12 @@ func solveRunning(ctx context.Context, wg *sync.WaitGroup, exp *v1alpha1.Experim return } else { - if expInfo.Status == v1alpha1.SuccessStatusType || expInfo.Status == v1alpha1.FailedStatusType || expInfo.Status == v1alpha1.RunningStatusType { + logger.Info("inject Handler", "expinfo", expInfo, "exp", exp) + if expInfo != nil && len(expInfo.Status) != 0 && (expInfo.Status == v1alpha1.SuccessStatusType || expInfo.Status == v1alpha1.FailedStatusType || expInfo.Status == v1alpha1.RunningStatusType) { targetSubExp[i].StartTime, targetSubExp[i].UpdateTime = expInfo.CreateTime, expInfo.UpdateTime targetSubExp[i].Status, targetSubExp[i].Message = expInfo.Status, expInfo.Message } else { - logger.Error(fmt.Errorf("unexpected status"), fmt.Sprintf("expInfo.Status is %s", expInfo.Status)) + logger.Error(fmt.Errorf("unexpected status"), fmt.Sprintf("expInfo is %s", expInfo)) return } } diff --git a/chaosmeta-inject-operator/pkg/phasehandler/recover/handler.go b/chaosmeta-inject-operator/pkg/phasehandler/recover/handler.go index a0bc1f8..e498f29 100644 --- a/chaosmeta-inject-operator/pkg/phasehandler/recover/handler.go +++ b/chaosmeta-inject-operator/pkg/phasehandler/recover/handler.go @@ -244,11 +244,11 @@ func solveRunning(ctx context.Context, wg *sync.WaitGroup, exp *v1alpha1.Experim return } else { - if expInfo.Status == v1alpha1.SuccessStatusType || expInfo.Status == v1alpha1.FailedStatusType || expInfo.Status == v1alpha1.RunningStatusType { + if expInfo != nil && len(expInfo.Status) != 0 && (expInfo.Status == v1alpha1.SuccessStatusType || expInfo.Status == v1alpha1.FailedStatusType || expInfo.Status == v1alpha1.RunningStatusType) { targetSubExp[i].Status, targetSubExp[i].Message = expInfo.Status, expInfo.Message targetSubExp[i].StartTime, targetSubExp[i].UpdateTime = expInfo.CreateTime, expInfo.UpdateTime } else { - logger.Error(fmt.Errorf("unexpected status"), fmt.Sprintf("expInfo.Status is %s", expInfo.Status)) + logger.Error(fmt.Errorf("unexpected status"), fmt.Sprintf("expInfo is %s", expInfo)) return } } From 477ddfb3d5d7c12763ce1008604caae2ac14f2d5 Mon Sep 17 00:00:00 2001 From: "wenkun.zwk" Date: Tue, 14 May 2024 18:10:25 +0800 Subject: [PATCH 2/4] update config setting --- chaosmeta-deploy/templates/chaosmeta-inject.yaml | 5 +++-- .../config/chaosmeta-inject.json | 12 ++++++------ .../pkg/executor/remoteexecutor/remoteexecutor.go | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chaosmeta-deploy/templates/chaosmeta-inject.yaml b/chaosmeta-deploy/templates/chaosmeta-inject.yaml index 068eb39..29c39bc 100644 --- a/chaosmeta-deploy/templates/chaosmeta-inject.yaml +++ b/chaosmeta-deploy/templates/chaosmeta-inject.yaml @@ -262,7 +262,7 @@ spec: livenessProbe: httpGet: path: /healthz - port: 8081 + port: 8083 initialDelaySeconds: 20 periodSeconds: 20 failureThreshold: 3 @@ -274,7 +274,7 @@ spec: readinessProbe: httpGet: path: /readyz - port: 8081 + port: 8083 initialDelaySeconds: 20 periodSeconds: 20 failureThreshold: 3 @@ -380,6 +380,7 @@ data: }, "daemonsetConfig": { "localExecPath": "/tmp", + "daemonName": "chaosmeta-daemon", "daemonNs": "chaosmeta", "daemonLabel": { "app.chaosmeta.io": "chaosmeta-daemon" diff --git a/chaosmeta-inject-operator/config/chaosmeta-inject.json b/chaosmeta-inject-operator/config/chaosmeta-inject.json index 324554f..386ac8a 100644 --- a/chaosmeta-inject-operator/config/chaosmeta-inject.json +++ b/chaosmeta-inject-operator/config/chaosmeta-inject.json @@ -21,14 +21,14 @@ "daemonName": "chaosmeta-daemon" }, "middlewareConfig" : { - "url" : "https://shell-api.alipay.com", + "url" : "todo", "mistConfig" : { - "antVipUrl" : "antvip-pool.stable.alipay.net", - "bkmiUrl" : "bkmi-pool.stable.global.alipay.com", - "appName" : "antchaos", + "antVipUrl" : "todo", + "bkmiUrl" : "todo", + "appName" : "chaosmetainject", "tenant" : "ALIPAY", - "mode" : "local", - "secretName" : "antchaos_fault_inject_offline" + "mode" : "todo", + "secretName" : "todo" } } } diff --git a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go index 864f240..16ef2bf 100644 --- a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go +++ b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/remoteexecutor.go @@ -60,7 +60,6 @@ func AutoSelectRemoteExecutor(ctx context.Context, config *config.ExecutorConfig /** * 启动时通道自动选择 */ - config.DaemonsetConfig.DaemonName = "chaosmeta-daemon" logger := log.FromContext(ctx) daemonSetRemoteExecutor := &daemonsetexecutor.DaemonsetRemoteExecutor{ RESTConfig: restConfig, From 534f46563c2bb8b0c639f8aed17b932ddf0a753c Mon Sep 17 00:00:00 2001 From: "wenkun.zwk" Date: Tue, 21 May 2024 14:55:59 +0800 Subject: [PATCH 3/4] update image version --- .../templates/chaosmeta-inject.yaml | 4 ++-- .../templates/chaosmeta-platform.yaml | 4 ++-- .../config/chaosmeta-inject.json | 2 +- chaosmeta-inject-operator/go.mod | 24 ------------------- chaosmeta-inject-operator/go.sum | 4 ++-- .../middlewareexecutor/tse/auth/signature.go | 22 ++--------------- .../experiment/experiment_custom_resource.go | 2 +- 7 files changed, 10 insertions(+), 52 deletions(-) diff --git a/chaosmeta-deploy/templates/chaosmeta-inject.yaml b/chaosmeta-deploy/templates/chaosmeta-inject.yaml index 29c39bc..8564785 100644 --- a/chaosmeta-deploy/templates/chaosmeta-inject.yaml +++ b/chaosmeta-deploy/templates/chaosmeta-inject.yaml @@ -248,7 +248,7 @@ spec: - --leader-elect command: - /manager - image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-inject-controller:v0.1.2 + image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-inject-controller:v0.1.3 imagePullPolicy: Always env: - name: DEFAULTNAMESPACE @@ -374,7 +374,7 @@ data: "executor": { "mode": "daemonset", "executor": "chaosmetad", - "version": "0.5.3", + "version": "0.5.1", "agentConfig": { "agentPort": 29595 }, diff --git a/chaosmeta-deploy/templates/chaosmeta-platform.yaml b/chaosmeta-deploy/templates/chaosmeta-platform.yaml index 3235fd9..721c405 100644 --- a/chaosmeta-deploy/templates/chaosmeta-platform.yaml +++ b/chaosmeta-deploy/templates/chaosmeta-platform.yaml @@ -89,7 +89,7 @@ spec: serviceAccountName: chaosmeta-platform containers: - name: chaosmeta-platform - image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-platform:v0.6.1 + image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-platform:v0.6.3 resources: requests: cpu: "1" @@ -101,7 +101,7 @@ spec: - name: chaosmeta-config mountPath: /home/admin/conf - name: chaosmeta-platform-frontend - image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-platform-frontend:v0.6.1 + image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-platform-frontend:v0.6.3 imagePullPolicy: Always ports: - containerPort: 8000 diff --git a/chaosmeta-inject-operator/config/chaosmeta-inject.json b/chaosmeta-inject-operator/config/chaosmeta-inject.json index 386ac8a..0ba0b28 100644 --- a/chaosmeta-inject-operator/config/chaosmeta-inject.json +++ b/chaosmeta-inject-operator/config/chaosmeta-inject.json @@ -8,7 +8,7 @@ "executor": { "mode": "daemonset", "executor": "chaosmetad", - "version": "0.5.3", + "version": "0.5.1", "agentConfig": { "agentPort": 29595 }, diff --git a/chaosmeta-inject-operator/go.mod b/chaosmeta-inject-operator/go.mod index 2539e07..7926369 100644 --- a/chaosmeta-inject-operator/go.mod +++ b/chaosmeta-inject-operator/go.mod @@ -15,29 +15,6 @@ require ( sigs.k8s.io/controller-runtime v0.14.1 ) -require ( - github.com/hashicorp/errwrap v1.0.0 // indirect - github.com/hashicorp/go-multierror v1.1.0 // indirect - github.com/jpillora/backoff v1.0.0 // indirect - github.com/magiconair/properties v1.8.5 // indirect - github.com/natefinch/lumberjack v2.0.0+incompatible // indirect - github.com/valyala/fastjson v1.5.1 // indirect - gitlab.alipay-inc.com/naming/naming-sdk-go v1.2.3 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-antvip-client-go v1.6.8 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-bolt-go v0.3.4 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-bolt-simplemap-go v0.2.1 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-conn-go v0.2.7 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-helper-go v0.1.0 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-hessian-go v0.2.4 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-logger-go v0.2.5 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-registry-client-go v1.1.0 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-registry-proto-go v0.1.1 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-syncpool-go v0.1.3 // indirect - gitlab.alipay-inc.com/sofa-go/sofa-writer-go v0.2.4 // indirect - google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect - google.golang.org/grpc v1.49.0 // indirect -) - require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -73,7 +50,6 @@ require ( github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - gitlab.alipay-inc.com/mist-sdk/mist_sdk_go v1.0.5 go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect diff --git a/chaosmeta-inject-operator/go.sum b/chaosmeta-inject-operator/go.sum index ea7b9c3..938190e 100644 --- a/chaosmeta-inject-operator/go.sum +++ b/chaosmeta-inject-operator/go.sum @@ -362,8 +362,8 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/tidwall/pretty v1.0.1/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/traas-stack/chaosmeta/chaosmeta-common v0.0.0-20240102105916-8f3b8d9accc5 h1:1RpFVSqiERGKUq2Yc6nioKEa0VyCXu0+t9vXpmK1WQ4= -github.com/traas-stack/chaosmeta/chaosmeta-common v0.0.0-20240102105916-8f3b8d9accc5/go.mod h1:291sLBmT/cXwucSh4T3kRmLX7JRlSNq5HY66PQtt4ow= +github.com/traas-stack/chaosmeta/chaosmeta-common v0.0.0-20240304074218-2b1da1d93caa h1:Z/0R8DkSZb0YBUN5wVDKmKiWV9D0vYC8iie6/DQuzmk= +github.com/traas-stack/chaosmeta/chaosmeta-common v0.0.0-20240304074218-2b1da1d93caa/go.mod h1:291sLBmT/cXwucSh4T3kRmLX7JRlSNq5HY66PQtt4ow= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/valyala/fastjson v1.5.1 h1:SXaQZVSwLjZOVhDEhjiCcDtnX0Feu7Z7A1+C5atpoHM= github.com/valyala/fastjson v1.5.1/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= diff --git a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/auth/signature.go b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/auth/signature.go index 2801fb4..0aa0864 100644 --- a/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/auth/signature.go +++ b/chaosmeta-inject-operator/pkg/executor/remoteexecutor/middlewareexecutor/tse/auth/signature.go @@ -2,8 +2,6 @@ package auth import ( "github.com/traas-stack/chaosmeta/chaosmeta-inject-operator/pkg/config" - "gitlab.alipay-inc.com/mist-sdk/mist_sdk_go/mist" - "log" ) type MistClient struct { @@ -11,22 +9,6 @@ type MistClient struct { } func (r *MistClient) MistConfig() (string, string) { - config := mist.NewMistConfig() - // 线下/线上AntVipUrl和BkmiUrl具体配置参看上面的 参数说明 - config.SetAntVipUrl(r.Config.AntVipUrl) - config.SetBkmiUrl(r.Config.BkmiUrl) - - config.SetAppName(r.Config.AppName) - config.SetTenant(r.Config.Tenant) - - // 线下/线上Mode具体配置参看上面的 参数说明 - config.SetMode(r.Config.Mode) - - client := mist.NewMistClient(config) - ak, sk, _, _, err := client.GetSecretInfo(r.Config.SecretName) - if err != nil { - log.Println(err) - return "", "" - } - return ak, sk + // internal code + return "", "" } diff --git a/chaosmeta-platform/pkg/service/experiment/experiment_custom_resource.go b/chaosmeta-platform/pkg/service/experiment/experiment_custom_resource.go index b15ebe9..41d2f1a 100644 --- a/chaosmeta-platform/pkg/service/experiment/experiment_custom_resource.go +++ b/chaosmeta-platform/pkg/service/experiment/experiment_custom_resource.go @@ -94,7 +94,7 @@ func GetWorkflowStruct(experimentInstanceId string, nodes []*experiment_instance }, Resource: &v1alpha1.ResourceTemplate{ Action: "create", - FailureCondition: "status.status == failed", + FailureCondition: "status.status in (failed, partSuccess)", SuccessCondition: "status.phase == recover,status.status == success", Manifest: fmt.Sprintf("{{inputs.parameters.%s}}", ParametersName), }, From a10701adce680018e1c3a81065ffe80019847621 Mon Sep 17 00:00:00 2001 From: "wenkun.zwk" Date: Tue, 21 May 2024 15:02:26 +0800 Subject: [PATCH 4/4] update image version --- chaosmeta-deploy/templates/chaosmeta-daemon.yaml | 2 +- chaosmeta-deploy/templates/chaosmeta-workflow.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chaosmeta-deploy/templates/chaosmeta-daemon.yaml b/chaosmeta-deploy/templates/chaosmeta-daemon.yaml index 6ceba8b..7dc711b 100644 --- a/chaosmeta-deploy/templates/chaosmeta-daemon.yaml +++ b/chaosmeta-deploy/templates/chaosmeta-daemon.yaml @@ -19,7 +19,7 @@ spec: # chaos-role.chaosmeta.io: chaosmeta-daemon containers: - name: chaosmeta-daemon - image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-daemon:v0.5.3 + image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/chaosmeta-daemon:v0.5.1 securityContext: privileged: true volumeMounts: diff --git a/chaosmeta-deploy/templates/chaosmeta-workflow.yaml b/chaosmeta-deploy/templates/chaosmeta-workflow.yaml index 1b93c40..714eda4 100644 --- a/chaosmeta-deploy/templates/chaosmeta-workflow.yaml +++ b/chaosmeta-deploy/templates/chaosmeta-workflow.yaml @@ -384,7 +384,7 @@ spec: - args: - server env: [] - image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/argocli:v3.4.10 + image: registry.cn-hangzhou.aliyuncs.com/chaosmeta/argocli:v3.4.10.3 name: argo-server ports: - containerPort: 2746