Skip to content

Commit 9a99f41

Browse files
author
Arik Kfir
committed
Override of "state()" method needs to re-annotate itself with "@action".
This is required so the "state" action is still recognized by the "execute(..)" method. Adapt testing of "check_availability" accordingly (validation of "timeout_ms > timeout_interval_ms" was moved from the constructor to the "state" method override)
1 parent 0fe5577 commit 9a99f41

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

resources/src/k8s.py

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def get_actions_for_discovered_state(self, state: dict) -> Sequence[DAction]:
9191
def build_kubectl_manifest(self) -> dict:
9292
return deepcopy(self.info.config['manifest'])
9393

94+
@action
9495
def state(self, args) -> None:
9596
if self.timeout_interval_ms >= self.timeout_ms:
9697
raise Exception(f"timeout interval ({self.timeout_interval_ms / 1000}) cannot be greater "

tests/test_resource_k8s.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def is_available(self, state: dict) -> bool:
4949
r"or equal to total timeout \(\d+(.\d+)?\) duration"):
5050
MockK8sResource(time_until_available_ms=time_until_available_ms,
5151
data=data,
52-
svc=MockExternalServices(k8s_objects={}))
52+
svc=MockExternalServices(k8s_objects={})).execute(["state"])
5353
else:
5454
resource = MockK8sResource(time_until_available_ms=time_until_available_ms,
5555
data=data,

0 commit comments

Comments
 (0)