From 207759888faec2ded01482564cf8eb73907b81b4 Mon Sep 17 00:00:00 2001 From: xcaspar Date: Wed, 1 Dec 2021 19:33:11 +0800 Subject: [PATCH] update chaosblade module version to v1.4.0 Signed-off-by: xcaspar --- Makefile | 3 +-- build/Dockerfile | 1 - .../helm/chaosblade-operator-for-v2/Chart.yaml | 4 ++-- .../templates/daemonset.yaml | 15 +++++++++++++++ .../chaosblade-operator-for-v2/values.yaml | 4 ++-- .../helm/chaosblade-operator-for-v3/Chart.yaml | 4 ++-- .../templates/daemonset.yaml | 15 +++++++++++++++ .../chaosblade-operator-for-v3/values.yaml | 4 ++-- exec/container/container.go | 4 ++++ exec/model/model.go | 2 +- go.mod | 15 +++++++-------- go.sum | 18 ++++++++++++++++++ 12 files changed, 69 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 42f61b7..6104f49 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,5 @@ .PHONY: build clean -BLADE_SRC_ROOT=`pwd` - GO_ENV=CGO_ENABLED=1 GO_MODULE=GO111MODULE=on GO=env $(GO_ENV) $(GO_MODULE) go @@ -58,6 +56,7 @@ build_linux: docker build -f build/musl/Dockerfile -t chaosblade-operator-build-musl:latest build/musl docker run --rm \ -v $(shell echo -n ${GOPATH}):/go \ + -v $(shell pwd):/go/src/github.com/chaosblade-io/chaosblade-operator \ -w /go/src/github.com/chaosblade-io/chaosblade-operator \ chaosblade-operator-build-musl:latest diff --git a/build/Dockerfile b/build/Dockerfile index d5df166..e027eec 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -12,7 +12,6 @@ COPY --from=builder ${OPERATOR} /usr/local/bin/ COPY build/cache/chaosblade ${CHAOSBLADE_HOME} COPY build/bin /usr/local/bin -RUN yum install net-tools -y RUN /usr/local/bin/user_setup ENTRYPOINT ["/usr/local/bin/entrypoint"] diff --git a/deploy/helm/chaosblade-operator-for-v2/Chart.yaml b/deploy/helm/chaosblade-operator-for-v2/Chart.yaml index 4518c55..5f21dce 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.3.0" +appVersion: "1.4.0" description: ChaosBlade Operator name: chaosblade-operator -version: 1.3.0 +version: 1.4.0 home: https://github.com/chaosblade-io diff --git a/deploy/helm/chaosblade-operator-for-v2/templates/daemonset.yaml b/deploy/helm/chaosblade-operator-for-v2/templates/daemonset.yaml index ae9303a..c6d3d7e 100644 --- a/deploy/helm/chaosblade-operator-for-v2/templates/daemonset.yaml +++ b/deploy/helm/chaosblade-operator-for-v2/templates/daemonset.yaml @@ -54,6 +54,12 @@ spec: name: docker-lib - mountPath: /etc/docker name: docker-etc + - mountPath: /run/containerd + name: containerd + - mountPath: /var/lib/containerd + name: containerd-lib + - mountPath: /etc/containerd + name: containerd-etc dnsPolicy: ClusterFirstWithHostNet hostNetwork: true hostPID: true @@ -80,5 +86,14 @@ spec: - hostPath: path: /var/log/audit name: audit + - hostPath: + path: /run/containerd + name: containerd + - hostPath: + path: /var/lib/containerd + name: containerd-lib + - hostPath: + path: /etc/containerd + name: containerd-etc serviceAccountName: chaosblade {{- end }} \ No newline at end of file diff --git a/deploy/helm/chaosblade-operator-for-v2/values.yaml b/deploy/helm/chaosblade-operator-for-v2/values.yaml index 2b80fb5..99aaf6a 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.3.0 + version: 1.4.0 # image.pullPolicy: must be Always|IfNotPresent|Never pullPolicy: IfNotPresent qps: 20 @@ -11,7 +11,7 @@ operator: blade: repository: chaosbladeio/chaosblade-tool - version: 1.3.0 + version: 1.4.0 pullPolicy: IfNotPresent downloadUrl: "" diff --git a/deploy/helm/chaosblade-operator-for-v3/Chart.yaml b/deploy/helm/chaosblade-operator-for-v3/Chart.yaml index 4518c55..5f21dce 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.3.0" +appVersion: "1.4.0" description: ChaosBlade Operator name: chaosblade-operator -version: 1.3.0 +version: 1.4.0 home: https://github.com/chaosblade-io diff --git a/deploy/helm/chaosblade-operator-for-v3/templates/daemonset.yaml b/deploy/helm/chaosblade-operator-for-v3/templates/daemonset.yaml index ae9303a..c6d3d7e 100644 --- a/deploy/helm/chaosblade-operator-for-v3/templates/daemonset.yaml +++ b/deploy/helm/chaosblade-operator-for-v3/templates/daemonset.yaml @@ -54,6 +54,12 @@ spec: name: docker-lib - mountPath: /etc/docker name: docker-etc + - mountPath: /run/containerd + name: containerd + - mountPath: /var/lib/containerd + name: containerd-lib + - mountPath: /etc/containerd + name: containerd-etc dnsPolicy: ClusterFirstWithHostNet hostNetwork: true hostPID: true @@ -80,5 +86,14 @@ spec: - hostPath: path: /var/log/audit name: audit + - hostPath: + path: /run/containerd + name: containerd + - hostPath: + path: /var/lib/containerd + name: containerd-lib + - hostPath: + path: /etc/containerd + name: containerd-etc serviceAccountName: chaosblade {{- end }} \ No newline at end of file diff --git a/deploy/helm/chaosblade-operator-for-v3/values.yaml b/deploy/helm/chaosblade-operator-for-v3/values.yaml index 198c838..c78816c 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.3.0 + version: 1.4.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.3.0 + version: 1.4.0 pullPolicy: IfNotPresent downloadUrl: "" diff --git a/exec/container/container.go b/exec/container/container.go index 7dbfe74..70e3503 100644 --- a/exec/container/container.go +++ b/exec/container/container.go @@ -249,6 +249,10 @@ blade create k8s pod-script delay --time 10000 --file test.sh --function-name st action.SetExample(` # Add commands to the script "start0() { echo this-is-error-message; exit 1; ... }" blade create k8s pod-script exit --exit-code 1 --exit-message this-is-error-message --file test.sh --function-name start0 --names nginx-app --container-ids f1de335b4eeaf --kubeconfig ~/.kube/config --namespace default`) + case *criexec.RemoveActionCommand: + action.SetExample(` +# Remove container in pod +blade create k8s container-container remove --names cart-redis-77 --container-names cart-redis --namespace default --kubeconfig ~/.kube/config`) default: action.SetExample(strings.Replace(action.Example(), fmt.Sprintf("blade create %s %s", expModelSpec.Name(), action.Name()), diff --git a/exec/model/model.go b/exec/model/model.go index ca7cb00..0b525cb 100644 --- a/exec/model/model.go +++ b/exec/model/model.go @@ -189,7 +189,7 @@ var ChaosBladeDeployModeFlag = &spec.ExpFlag{ var IsDockerNetworkFlag = &spec.ExpFlag{ Name: "is-docker-network", - Desc: "Used when a docker container is used and there is no tc command in the target container. Just for docker command, Deprecated!", + Desc: "Used when a docker container is used and there is no tc command in the target container. Just for docker command, Deprecated! Please use use-sidecar-container-network flag.", NoArgs: true, Required: false, } diff --git a/go.mod b/go.mod index 55f7d52..1279ae6 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,13 @@ module github.com/chaosblade-io/chaosblade-operator require ( - github.com/chaosblade-io/chaosblade-exec-cri v0.0.0-20211125032821-6859ddfdf8de - github.com/chaosblade-io/chaosblade-exec-docker v1.3.1-0.20210906073714-7bd7d7367d76 - github.com/chaosblade-io/chaosblade-exec-os v1.3.1-0.20210906070659-0b8e3c15c25b - github.com/chaosblade-io/chaosblade-spec-go v1.3.1-0.20211124120331-a95ad0aac789 + github.com/chaosblade-io/chaosblade-exec-cri v1.4.0 + github.com/chaosblade-io/chaosblade-exec-docker v1.4.0 + github.com/chaosblade-io/chaosblade-exec-os v1.4.0 + github.com/chaosblade-io/chaosblade-spec-go v1.4.0 github.com/ethercflow/hookfs v0.3.0 + github.com/go-logr/logr v0.2.1 + github.com/go-logr/zapr v0.2.0 github.com/go-openapi/spec v0.19.4 github.com/hanwen/go-fuse v1.0.0 github.com/operator-framework/operator-sdk v0.17.0 @@ -18,9 +20,6 @@ require ( sigs.k8s.io/controller-runtime v0.6.0 ) -replace ( - github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.2+incompatible // Required by OLM - k8s.io/client-go => k8s.io/client-go v0.20.6 // Required by prometheus-operator -) +replace k8s.io/client-go => k8s.io/client-go v0.20.6 // Required by prometheus-operator go 1.13 diff --git a/go.sum b/go.sum index 21e5fb3..6987ad1 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,12 @@ github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxw github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v13.3.2+incompatible h1:VxzPyuhtnlBOzc4IWCZHqpyH2d+QMLQEuy3wREyY4oc= github.com/Azure/go-autorest v13.3.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.3-0.20191028180845-3492b2aff503 h1:uUhdsDMg2GbFLF5GfQPtLMWd5vdDZSfqvqQp3waafxQ= github.com/Azure/go-autorest/autorest v0.9.3-0.20191028180845-3492b2aff503/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -152,6 +156,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= @@ -175,14 +180,22 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/chaosblade-io/chaosblade-exec-cri v0.0.0-20211125032821-6859ddfdf8de/go.mod h1:l+htBu/es3gaGRCIenFytUbiGJrf9lwWfa6aLevnuG4= +github.com/chaosblade-io/chaosblade-exec-cri v1.4.0 h1:CIF0YZfUtAaZ0x4Ywlr9OPzDcY0E97h4SZFH4HGbMs8= +github.com/chaosblade-io/chaosblade-exec-cri v1.4.0/go.mod h1:6JkPqaZFudxZgugVIrCpsayydQ64PRMQwHdJl35Zx9s= github.com/chaosblade-io/chaosblade-exec-docker v1.3.1-0.20210906073714-7bd7d7367d76 h1:iiql3WhiZfc2vun/5cgkEh55pEn7DQRrEfgnjS9HDwQ= github.com/chaosblade-io/chaosblade-exec-docker v1.3.1-0.20210906073714-7bd7d7367d76/go.mod h1:1Kw89LAMohV44kwEZhofUGxtX/5LmhkXB+SNQ9KCzNY= +github.com/chaosblade-io/chaosblade-exec-docker v1.4.0 h1:NVC2VInDvTxooJKYzVu8qS8fEOabgvYMeii/Dv49kQA= +github.com/chaosblade-io/chaosblade-exec-docker v1.4.0/go.mod h1:4qPs5UNSYkYTOPGzaSdI/DhQ7lX99i4QUlYWouvgmTU= github.com/chaosblade-io/chaosblade-exec-os v1.3.1-0.20210906070659-0b8e3c15c25b h1:uQ4Cl9wljgC6Lql9bo+W0j+8AJSyXIhRx3UXkpjKmQc= github.com/chaosblade-io/chaosblade-exec-os v1.3.1-0.20210906070659-0b8e3c15c25b/go.mod h1:iAW5L9EbWcbZe+BSnpDbtVz7lLppkj2c676ziOft4II= +github.com/chaosblade-io/chaosblade-exec-os v1.4.0 h1:/WTfyezz0TaNtvGQgrL/RPvpjfZZgZEb32uaWukTTbU= +github.com/chaosblade-io/chaosblade-exec-os v1.4.0/go.mod h1:C/PKAeI2VE11dG+niR2YrlWTsBnUSHMWI3azKqHNKvQ= github.com/chaosblade-io/chaosblade-spec-go v1.3.1-0.20210906070321-ae22844733f2/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= github.com/chaosblade-io/chaosblade-spec-go v1.3.1-0.20210906082427-bfa0d01f5621 h1:zwwQNgnbr7afy/t+F4k+Br/5WM5T9OaKgE7AEnxnhSA= github.com/chaosblade-io/chaosblade-spec-go v1.3.1-0.20210906082427-bfa0d01f5621/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= github.com/chaosblade-io/chaosblade-spec-go v1.3.1-0.20211124120331-a95ad0aac789/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= +github.com/chaosblade-io/chaosblade-spec-go v1.4.0 h1:NWGOoRpo4dFARgau6WqqaIaqj3KGxKIJZZF9W1JbkBE= +github.com/chaosblade-io/chaosblade-spec-go v1.4.0/go.mod h1:xUF+8r54FphQjBR8fVPnweVqzu7EitE15UsnZ57O5gk= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -444,9 +457,13 @@ github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.2.1 h1:fV3MLmabKIZ383XifUjFSwcoGee0v9qgPp8wy5svibE= +github.com/go-logr/logr v0.2.1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= +github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= @@ -1184,6 +1201,7 @@ go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKY go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc=