Skip to content

[litmus-python] Issue with kubernetes.client library #5387

@Guigui0812

Description

@Guigui0812

What happened:

time=2026-01-09 10:03:23,274 level=INFO  msg=Experiment Name: aws-az-chaos
time=2026-01-09 10:03:23,274 level=INFO  msg=[PreReq]: Initialise Chaos Variables for the aws-az-chaos experiment
time=2026-01-09 10:03:23,274 level=INFO  msg=[PreReq]: Updating the chaos result of aws-az-chaos experiment (SOT)
Traceback (most recent call last):
  File "experiment", line 33, in <module>
    main()
  File "experiment", line 28, in main
    aws_az_chaos.AwsAzExperiment(clients)
  File "/litmus/experiments/aws_az/aws_az_chaos/experiment/aws_az_chaos.py", line 48, in AwsAzExperiment
    events.GenerateEvents(eventsDetails, chaosDetails, "ChaosResult", clients)
  File "/litmus/pkg/events/events.py", line 50, in GenerateEvents
    err = CreateEvents(eventsDetails, chaosDetails, kind, eventName, clients)
  File "/litmus/pkg/events/events.py", line 9, in CreateEvents
    event = client.V1Event(
AttributeError: module 'kubernetes.client' has no attribute 'V1Event'

What you expected to happen:

The experiment should not crash and run smoothly.

Where can this issue be corrected? (optional)

In this file of litmus-python repo, we should replace client.V1Event by client.CoreV1Event.

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

Run aws-az-chaos experiment on an EKS, and do :

time=2026-01-09 10:02:08,382 level=INFO  msg=Experiment Name: aws-az-chaos
time=2026-01-09 10:02:08,382 level=INFO  msg=[PreReq]: Initialise Chaos Variables for the aws-az-chaos experiment
time=2026-01-09 10:02:08,383 level=INFO  msg=[PreReq]: Updating the chaos result of aws-az-chaos experiment (SOT)
Traceback (most recent call last):
  File "experiment", line 33, in <module>
    main()
  File "experiment", line 28, in main
    aws_az_chaos.AwsAzExperiment(clients)
  File "/litmus/experiments/aws_az/aws_az_chaos/experiment/aws_az_chaos.py", line 48, in AwsAzExperiment
    events.GenerateEvents(eventsDetails, chaosDetails, "ChaosResult", clients)
  File "/litmus/pkg/events/events.py", line 50, in GenerateEvents
    err = CreateEvents(eventsDetails, chaosDetails, kind, eventName, clients)
  File "/litmus/pkg/events/events.py", line 9, in CreateEvents
    event = client.V1Event(
AttributeError: module 'kubernetes.client' has no attribute 'V1Event'

Anything else we need to know?:

I'll try to resolve this issue by my self.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions