-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAIN-1753 - patched pod conditions (#295)
This can be tested with https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/controllers/job-pod-failure-policy-failjob.yaml
- Loading branch information
1 parent
99ce16c
commit c400fc8
Showing
2 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import logging | ||
|
||
from kubernetes.client.models.v1_pod_failure_policy_rule import V1PodFailurePolicyRule | ||
|
||
def create_monkey_patches(): | ||
""" | ||
The python kubernetes client will throw exceptions for specific fields that were not allowed to be None on older versions of kubernetes. | ||
""" | ||
logger = logging.getLogger("krr") | ||
logger.debug("Creating kubernetes python cli monkey patches") | ||
|
||
def patched_setter_pod_failure_policy(self, on_pod_conditions): | ||
self._on_pod_conditions = on_pod_conditions | ||
|
||
V1PodFailurePolicyRule.on_pod_conditions = V1PodFailurePolicyRule.on_pod_conditions.setter(patched_setter_pod_failure_policy) |