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

Exception when matching on a node's group #321

Open
jcstanaway opened this issue Mar 31, 2021 · 1 comment
Open

Exception when matching on a node's group #321

jcstanaway opened this issue Mar 31, 2021 · 1 comment

Comments

@jcstanaway
Copy link
Contributor

Using image 3.1.0.

Created scenario:

apiVersion: powerfulseal.io/v1
kind: Scenario
metadata:
  name: default-node-death
  namespace: kube-system
spec:
  name: default-node-death
  description: "default nodegroup: kill a single node"
  steps:
    - nodeAction:
        matches:
          - property:
              name: group
              value: default
          - property:
              name: group
              negative: true
              value: master
          - property:
              name: group
              negative: true
              value: etcd
        filters:
          - probability: 0.1
          - randomSample:
              ratio: 0.34
          - randomSample:
              size: 1
        actions:
          - stop:
              autoRestart: false

Loaded the scenario and when seal attempted to execute the scenario, it threw an uncaught exception and exited:

2021-03-30 00:02:10 INFO scenario.default-node-de Starting scenario 'default-node-death' (1 steps)
Traceback (most recent call last):
  File "/usr/local/bin/powerfulseal", line 8, in <module>
    sys.exit(start())
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/cli/__main__.py", line 656, in start
    main(sys.argv[1:])
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/cli/__main__.py", line 630, in main
    metric_collector=metric_collector
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/policy/policy_runner.py", line 112, in run
    ret = scenario.execute()
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/policy/scenario.py", line 60, in execute
    ret = action_method(schema=step.get(action_name))
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/policy/scenario.py", line 95, in action_nodes
    return self.execute_action(action)
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/policy/scenario.py", line 82, in execute_action
    ret_val = action.execute()
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/policy/action_nodes_pods.py", line 51, in execute
    initial_set = self.match()
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/policy/action_nodes.py", line 48, in match
    if self.match_property(node, match):
  File "/usr/local/lib/python3.7/site-packages/powerfulseal/policy/action_nodes_pods.py", line 80, in match_property
    value = getattr(candidate, name)
AttributeError: 'Node' object has no attribute 'group'

I suspect it's an issue of "group" vs. "groups". When in interactive mode:

(seal) $ nodes
[node no=166 id=REDACTED ip=REDACTED extIp=REDACTED az=nope groups=['2', 'Standard_D4s_v3', 'amd64', 'default', 'REDACTED', 'e9ae415dc7b6ac569ada5eef11dde1dbb162a674868aef209c826bea00c820', 'eastus', 'eastus-3', 'linux', 'node'] name=REDACTED state=UNKNOWN]
[...]
@emyes
Copy link

emyes commented Jun 30, 2022

Hello everyone,

Can we get some assistance on this issue. We are also facing similar issue while running powerful incluster deployment on kubeseal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants