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

UDN: add wait_for_network_ready #2265

Merged
merged 7 commits into from
Jan 14, 2025
16 changes: 16 additions & 0 deletions ocp_resources/user_defined_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ def to_dict(self) -> None:

# End of generated code

def wait_for_network_ready(self, timeout: int = 30) -> None:
"""
Wait for the network to be ready.

Args:
timeout (int, optional): Maximum time to wait in seconds. Defaults to 30.

Raises:
TimeoutExpiredError: If the network is not ready within the specified timeout.
"""
self.wait_for_condition(
condition=self.Condition.NETWORK_READY,
status=self.Condition.Status.TRUE,
timeout=timeout,
)


class Layer2UserDefinedNetwork(UserDefinedNetwork):
"""
Expand Down
1 change: 1 addition & 0 deletions ocp_resources/utils/resource_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Condition:
RECONCILE_COMPLETE: str = "ReconcileComplete"
READY: str = "Ready"
FAILING: str = "Failing"
NETWORK_READY = "NetworkReady"
myakove marked this conversation as resolved.
Show resolved Hide resolved

class Status:
TRUE: str = "True"
Expand Down