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

TypeError: delete_namespaced_pod() takes 3 positional arguments but 4 were given #34

Closed
RaviHari opened this issue Mar 25, 2019 · 4 comments
Assignees
Labels

Comments

@RaviHari
Copy link

I am getting this error:

TypeError: delete_namespaced_pod() takes 3 positional arguments but 4 were given
when trying to kill a pod with latest chaostolkit-kubernetes ..

here is the json:

{
    "version": "1.0.0",
    "title": "System is resilient to provider's failures",
    "description": "Can our consumer survive gracefully a provider's failure?",
    "method": [
        {
            "type": "probe",
            "name": "count-pods-before-termination",
            "provider": {
                "type": "python",
                "module": "chaosk8s.pod.probes",
                "func": "count_pods",
                "arguments": {
                    "label_selector": "app=nginx",
                    "ns": "ns1"
                }
            },
            "pauses": {
                "after": 10
            }
        },
        {
            "type": "action",
            "name": "Terminate_pod",
            "provider": {
                "type": "python",
                "module": "chaosk8s.pod.actions",
                "func": "terminate_pods",
                "arguments": {
                    "label_selector": "app=nginx",
                    "ns": "ns1"
                }
            },
            "pauses": {
                "after": 2
            }
        },
        {
            "type": "probe",
            "name": "count-pods-after-termintation",
            "provider": {
                "type": "python",
                "module": "chaosk8s.pod.probes",
                "func": "count_pods",
                "arguments": {
                    "label_selector": "app=nginx",
                    "ns": "ns1"
                }
            },
            "pauses": {
                "after": 10
            }
        }

    ],
    "rollbacks": [
    ]
}
@Lawouach
Copy link
Contributor

Indeed.

I don't know if the API changed or, more likely, it was a mistake from the extension's code.

https://github.com/chaostoolkit/chaostoolkit-kubernetes/blob/master/chaosk8s/pod/actions.py#L96

should be

res = v1.delete_namespaced_pod(p.metadata.name, ns, body=body)

I'll fix and release.

Thanks!

@Lawouach Lawouach self-assigned this Mar 25, 2019
@Lawouach Lawouach added the bug label Mar 25, 2019
@RaviHari
Copy link
Author

Thanks!!

@Lawouach
Copy link
Contributor

Please try to update chaostoolkit-kubernetes :)

https://pypi.org/project/chaostoolkit-kubernetes/

pip install -U chaostoolkit-kubernetes

@RaviHari
Copy link
Author

works fine now.. thanks!

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

No branches or pull requests

2 participants