Skip to content

Commit

Permalink
add field_selector to get_events probe
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
  • Loading branch information
Lawouach committed Mar 14, 2024
1 parent 9eb435a commit e023420
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

## [Unreleased][]

[Unreleased]: https://github.com/chaostoolkit/chaostoolkit-kubernetes/compare/0.34.1...HEAD
[Unreleased]: https://github.com/chaostoolkit/chaostoolkit-kubernetes/compare/0.35.0...HEAD

## [0.35.0][] - 2024-03-14

[0.35.0]: https://github.com/chaostoolkit/chaostoolkit-kubernetes/compare/0.34.1...0.35.0

### Changed

* Added `field_selector` to the `get_events` probe

## [0.34.1][] - 2023-11-13

Expand Down
2 changes: 1 addition & 1 deletion chaosk8s/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from logzero import logger

__all__ = ["create_k8s_api_client", "discover", "__version__"]
__version__ = "0.34.1"
__version__ = "0.35.0"


def get_config_path() -> str:
Expand Down
6 changes: 5 additions & 1 deletion chaosk8s/event/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

def get_events(
label_selector: str = None,
field_selector: str = None,
limit: int = 100,
configuration: Configuration = None,
secrets: Secrets = None,
Expand All @@ -23,7 +24,10 @@ def get_events(

v1 = client.EventsV1Api(api)
ret = v1.list_event_for_all_namespaces(
_preload_content=False, label_selector=label_selector, limit=limit
_preload_content=False,
label_selector=label_selector,
field_selector=field_selector,
limit=limit,
)

return json.loads(ret.read().decode("utf-8"))

0 comments on commit e023420

Please sign in to comment.