From 5f75d552ff229381629d4f763115f56546342ecd Mon Sep 17 00:00:00 2001 From: tiny-x Date: Mon, 31 May 2021 17:21:31 +0800 Subject: [PATCH] fix: copy chaos_os bin & update charts version to 1.2.0 Signed-off-by: tiny-x --- deploy/helm/chaosblade-operator-for-v2/Chart.yaml | 4 ++-- deploy/helm/chaosblade-operator-for-v2/values.yaml | 4 ++-- deploy/helm/chaosblade-operator-for-v3/Chart.yaml | 4 ++-- deploy/helm/chaosblade-operator-for-v3/values.yaml | 4 ++-- exec/model/executor.go | 8 ++++++++ go.sum | 6 ++++++ 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/deploy/helm/chaosblade-operator-for-v2/Chart.yaml b/deploy/helm/chaosblade-operator-for-v2/Chart.yaml index 2d138d3..908cd47 100644 --- a/deploy/helm/chaosblade-operator-for-v2/Chart.yaml +++ b/deploy/helm/chaosblade-operator-for-v2/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 -appVersion: "1.0.0" +appVersion: "1.2.0" description: ChaosBlade Operator name: chaosblade-operator -version: 1.0.0 +version: 1.2.0 home: https://github.com/chaosblade-io diff --git a/deploy/helm/chaosblade-operator-for-v2/values.yaml b/deploy/helm/chaosblade-operator-for-v2/values.yaml index 225a957..59ec21e 100644 --- a/deploy/helm/chaosblade-operator-for-v2/values.yaml +++ b/deploy/helm/chaosblade-operator-for-v2/values.yaml @@ -3,7 +3,7 @@ # chaosblade-operator operator: repository: chaosbladeio/chaosblade-operator - version: 1.0.0 + version: 1.2.0 # image.pullPolicy: must be Always|IfNotPresent|Never pullPolicy: IfNotPresent qps: 20 @@ -11,7 +11,7 @@ operator: blade: repository: chaosbladeio/chaosblade-tool - version: 1.0.0 + version: 1.2.0 pullPolicy: IfNotPresent env: diff --git a/deploy/helm/chaosblade-operator-for-v3/Chart.yaml b/deploy/helm/chaosblade-operator-for-v3/Chart.yaml index 2d138d3..908cd47 100644 --- a/deploy/helm/chaosblade-operator-for-v3/Chart.yaml +++ b/deploy/helm/chaosblade-operator-for-v3/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 -appVersion: "1.0.0" +appVersion: "1.2.0" description: ChaosBlade Operator name: chaosblade-operator -version: 1.0.0 +version: 1.2.0 home: https://github.com/chaosblade-io diff --git a/deploy/helm/chaosblade-operator-for-v3/values.yaml b/deploy/helm/chaosblade-operator-for-v3/values.yaml index 3308b8d..de6c3c6 100644 --- a/deploy/helm/chaosblade-operator-for-v3/values.yaml +++ b/deploy/helm/chaosblade-operator-for-v3/values.yaml @@ -3,7 +3,7 @@ # chaosblade-operator operator: repository: chaosbladeio/chaosblade-operator - version: 1.0.0 + version: 1.2.0 # image.pullPolicy: must be Always|IfNotPresent|Never pullPolicy: IfNotPresent # qps of kubernetes client @@ -12,7 +12,7 @@ operator: blade: repository: chaosbladeio/chaosblade-tool - version: 1.0.0 + version: 1.2.0 pullPolicy: IfNotPresent env: diff --git a/exec/model/executor.go b/exec/model/executor.go index 19ba740..ad5cb0c 100644 --- a/exec/model/executor.go +++ b/exec/model/executor.go @@ -410,6 +410,14 @@ func (e *ExecCommandInPodExecutor) deployChaosBlade(experimentId string, expMode return fmt.Errorf("deploy yaml failed, %v", err), spec.ParameterInvalidBladePathError } } + chaosOSPath := path.Join(chaosBladePath, "bin", "chaos_os") + if override || options.CheckFileExists(chaosOSPath) != nil { + if err := options.CopyToPod(experimentId, path.Join(chaosblade.OperatorChaosBladeBin, "chaos_os"), chaosOSPath); err != nil { + util.Errorf(experimentId, util.GetRunFuncName(), fmt.Sprintf("deploy chaos_os failed! dir: %s, err: %s", chaosOSPath, err.Error())) + return fmt.Errorf("deploy chaos_os failed, %v", err), spec.ParameterInvalidBladePathError + } + } + // 按需复制 for _, program := range expModel.ActionPrograms { var programFile, operatorProgramFile string diff --git a/go.sum b/go.sum index c479dd8..72ddc2f 100644 --- a/go.sum +++ b/go.sum @@ -140,6 +140,8 @@ github.com/chaosblade-io/chaosblade-exec-docker v1.0.1-0.20210409014035-355048b6 github.com/chaosblade-io/chaosblade-exec-docker v1.0.1-0.20210409014035-355048b67b24/go.mod h1:D7llhCPn5BhFq/MTow0Flf1hJofQ4Xbhk+cR+013g9A= github.com/chaosblade-io/chaosblade-exec-docker v1.2.0-dev h1:NzvHIM9c92Cv7HgMQUPlS20kfOqN9h03qWAhMHG9sDY= github.com/chaosblade-io/chaosblade-exec-docker v1.2.0-dev/go.mod h1:kuiEGZOPwza6UYHycsDFNA54r7L56V+RnD9Ek92g6hE= +github.com/chaosblade-io/chaosblade-exec-docker v1.2.0 h1:WDFV47KXFL+KIcS2rbB1Qx6cZOILY9A1R/tKnfEyRW8= +github.com/chaosblade-io/chaosblade-exec-docker v1.2.0/go.mod h1:DTnXk+ffy8gffDjvKHGJU+o3Hk1G/v4L6BkFl/0JqiA= github.com/chaosblade-io/chaosblade-exec-os v0.6.1-0.20200927065130-0c862f860af4 h1:TsDJNVy/X+xEtt59TL1RJZwYxmka2hRvKA/V2ILZihE= github.com/chaosblade-io/chaosblade-exec-os v0.6.1-0.20200927065130-0c862f860af4/go.mod h1:DlrbABYAjnJy8hL02l1s8Lkwqab4vQqLQoP0hpuwWrs= github.com/chaosblade-io/chaosblade-exec-os v0.7.0 h1:GAXbrOwQJBdLUN6pQTlRwJak4pGZI3lCyBhDJ6j+vOA= @@ -162,6 +164,8 @@ github.com/chaosblade-io/chaosblade-exec-os v1.0.1-0.20210408072857-7eed94250576 github.com/chaosblade-io/chaosblade-exec-os v1.0.1-0.20210408072857-7eed94250576/go.mod h1:mPjULhOBrNl2nxuUJ4+FGf4ApEZD7oxiooy/4SMdaLU= github.com/chaosblade-io/chaosblade-exec-os v1.0.1-0.20210531060744-391a4b5e3454 h1:xsVVQiOj5jvEUS7cXvPpfL31hY8l7Hs3+OyDyO0P61c= github.com/chaosblade-io/chaosblade-exec-os v1.0.1-0.20210531060744-391a4b5e3454/go.mod h1:NPmsiENi1L3l+wKvLDib/s395YkAXaEqwrVIWZUomDM= +github.com/chaosblade-io/chaosblade-exec-os v1.2.0 h1:GPv6JC/jh7NosY8cIUBF1P3chOb/eG62tLdsXnwj8sM= +github.com/chaosblade-io/chaosblade-exec-os v1.2.0/go.mod h1:NPmsiENi1L3l+wKvLDib/s395YkAXaEqwrVIWZUomDM= github.com/chaosblade-io/chaosblade-spec-go v0.6.1-0.20200925094651-195e67548e88 h1:ItqhUB0U7B0bCeeDR4HwGhUfRlkxCVOtaGLcogk0P3U= github.com/chaosblade-io/chaosblade-spec-go v0.6.1-0.20200925094651-195e67548e88/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= github.com/chaosblade-io/chaosblade-spec-go v0.7.0 h1:EPBG8ZjWNjErgjdDaZqI/9UwZLgBY/2o1x8jes68kAU= @@ -180,6 +184,8 @@ github.com/chaosblade-io/chaosblade-spec-go v1.0.1-0.20210531022335-b8bb425f7cb9 github.com/chaosblade-io/chaosblade-spec-go v1.0.1-0.20210531022335-b8bb425f7cb9/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= github.com/chaosblade-io/chaosblade-spec-go v1.1.0-dev h1:UM/SHVOIEh5w46iQHi/BgJWe1n+YE5ugKOCQ5HzlzRg= github.com/chaosblade-io/chaosblade-spec-go v1.1.0-dev/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= +github.com/chaosblade-io/chaosblade-spec-go v1.2.0 h1:f1AAqUqrWMPPOYu6JacpUQCVlxe6oFKMhfe0ZMivRQI= +github.com/chaosblade-io/chaosblade-spec-go v1.2.0/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=