Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete pod in command line failed. ERROR: unknown flag: --labels #244

Closed
hechuan73 opened this issue Nov 29, 2019 · 1 comment
Closed

Delete pod in command line failed. ERROR: unknown flag: --labels #244

hechuan73 opened this issue Nov 29, 2019 · 1 comment
Assignees
Labels
chaosblade-operator chaosblade-operator project type/bug Something isn't working
Milestone

Comments

@hechuan73
Copy link

Issue Description

Type: feature request

Describe what happened (or what feature you want)

I want to delete the pod in command line, but it failed and get error: unknown flag: --labels

[root@k8s-master chaosblade-0.4.0]# ./blade create k8s pod-pod delete --labels app=ts-station-mysql --namespace default --evict-count 1 --kubeconfig /etc/kubernetes/admin.conf 
unknown flag: --labels

But I executed it successfully in yaml configuration file.

[root@k8s-master chaos-test]# kubectl apply -f delete-pod.yaml 
chaosblade.chaosblade.io/delete-two-pod-by-labels created
[root@k8s-master chaos-test]# 
[root@k8s-master chaos-test]# kubectl get pods
NAME                                READY   STATUS    RESTARTS   AGE
ts-station-mysql-58975db444-d2hj9   1/1     Running   0          7s

BTW, in the version 0.4.0-alpha, I can not get the help information in the deep command level, such as:

[root@k8s-master chaosblade-0.4.0]# ./blade create k8s -h
Create a chaos engineering experiment

I can only get the info "Create a chaos engineering experiment". Even if i execute a create command:

[root@k8s-master chaosblade-0.4.0]# ./blade create cpu load
Create a chaos engineering experiment
[root@k8s-master chaosblade-0.4.0]# ./blade create cpu load --cpu-count 2
unknown flag: --cpu-count

So I dont know how to create experiment in version 0.0.4-alpha. Since there are many changes in architecture of the tool in version 0.0.4-alpha, so is the deployment of the tool changed? I have deployed the chaosclade-operator and chaosblade-tool and built the choasblade-cli. Can you give me some suggestions guys, thanks!

Describe what you expected to happen

Create the experiments in command line and more docs info of the version 0.0.4-alpha.

How to reproduce it (as minimally and precisely as possible)

  1. build the choasblade-cli in make.
  2. execute command in the command line to get error info:
./blade create k8s pod-pod delete --labels app=ts-station-mysql --namespace default --evict-count 1 --kubeconfig /etc/kubernetes/admin.conf
  1. execute command with k8s deployment yaml file to get successful result.

Tell us your environment

[root@k8s-master chaosblade-0.4.0]# ./blade version
version: 0.4.0
env: #1 SMP Mon May 21 23:36:36 UTC 2018 x86_64
build-time: Thu Nov 28 17:05:14 CST 2019
[root@k8s-master chaosblade-0.4.0]# kubectl version 
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
[root@k8s-master chaosblade-0.4.0]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 
[root@k8s-master chaosblade-0.4.0]# docker version
Client:
 Version:           18.09.5
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        e8ff056
 Built:             Thu Apr 11 04:43:34 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.5
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       e8ff056
  Built:            Thu Apr 11 04:13:40 2019
  OS/Arch:          linux/amd64
  Experimental:     false
[root@k8s-master chaosblade-0.4.0]# kubectl get pods -n kube-system 
NAME                                   READY   STATUS    RESTARTS   AGE
chaosblade-operator-78d8c78879-pm8vc   1/1     Running   2          21d
chaosblade-tool-hjbfb                  1/1     Running   1          3d18h
chaosblade-tool-rqsnc                  1/1     Running   2          21d
chaosblade-tool-slqc8                  1/1     Running   2          21d
chaosblade-tool-t8qzn                  1/1     Running   2          21d

Anything else we need to know?

@xcaspar
Copy link
Member

xcaspar commented Dec 2, 2019

I have fixed the makefile in #243 PR, please pull new codes in master and rebuild it. Thanks.

@xcaspar xcaspar added this to the 0.4.0 milestone Dec 2, 2019
@xcaspar xcaspar added type/bug Something isn't working chaosblade-operator chaosblade-operator project labels Feb 18, 2020
@xcaspar xcaspar self-assigned this Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chaosblade-operator chaosblade-operator project type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants