You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem with the data type of Attributes and pods in class Selector. It should be a dictionary instead of a list.
Reproduction steps
I follow the official documentation to inject faults into the service. The script is as follows:
import uuid
from chaosmesh.client import Client, Experiment
from chaosmesh.k8s.selector import Selector
# creating the ChaosMesh client
client = Client(version="v1alpha1")
# target pods selector; by labelSector or by pods in specified namespaces
selector = Selector(labelSelectors=None, pods=["my-cnosdb-meta-0"], namespaces=["cnosdb-community-latest-3meta-2querytskv"])
print(selector);
exp_name = str(uuid.uuid4())
# starting up the pod kill experiment
client.start_experiment(Experiment.POD_KILL, namespace="cnosdb-community-latest-3meta-2querytskv", name=exp_name, selector=selector)
but the result as follow:
admission webhook "mpodchaos.kb.io" denied the request: json: cannot unmarshal array into Go struct field PodSelectorSpec.spec.selector.pods of type map[string][]string",
Later, I changed the type of pods and wrote it as a dictionary. I found that the injection failure was normal as follows:
import uuid
from chaosmesh.client import Client, Experiment
from chaosmesh.k8s.selector import Selector
# creating the ChaosMesh client
client = Client(version="v1alpha1")
# target pods selector; by labelSector or by pods in specified namespaces
selector = Selector(labelSelectors=None, pods={"cnosdb-community-latest-3meta-2querytskv": ["my-cnosdb-meta-0"]}, namespaces=["cnosdb-community-latest-3meta-2querytskv"])
print(selector);
exp_name = str(uuid.uuid4())
# starting up the pod kill experiment
client.start_experiment(Experiment.POD_KILL, namespace="cnosdb-community-latest-3meta-2querytskv", name=exp_name, selector=selector)
Describe the bug
There is a problem with the data type of Attributes and pods in class Selector. It should be a dictionary instead of a list.
Reproduction steps
I follow the official documentation to inject faults into the service. The script is as follows:
but the result as follow:
Later, I changed the type of pods and wrote it as a dictionary. I found that the injection failure was normal as follows:
the result:
...
Expected behavior
1
Additional context
1
The text was updated successfully, but these errors were encountered: