saltext.kubernetes.utils._kinds¶
Kind registry for the saltext-kubernetes extension.
A single source of truth for per-Kubernetes-kind metadata used by the wait subsystem and (future) the operations modules:
which kubernetes-client API class hosts the kind’s CRUD methods (e.g.
CoreV1Apifor Pod,AppsV1Apifor Deployment)the name of the
list_*andread_*methods on that classwhether the kind is namespaced or cluster-scoped
a readiness predicate evaluated against a live API object
Adding a new typed kind is one entry in _KIND_REGISTRY plus
its public CRUD functions on kubernetesmod. Before this
registry existed the kind→method mapping lived as a duplicated literal
dict in _wait_for_resource_status() (twice — once for the
“deleted” path’s read_* lookup, once for the “created/ready”
path’s list_* lookup).
- class saltext.kubernetes.utils._kinds.KindOps(api_class_attr: str, list_method: str, read_method: str, namespaced: bool, ready_predicate: Callable[[object], bool])[source]¶
Per-kind metadata for the wait subsystem.
- saltext.kubernetes.utils._kinds.match_condition(obj, condition_type, expected_status='True')[source]¶
Match
obj.status.conditions[?type == condition_type].status.Mirrors
kubectl wait --for=condition=Ready=truesemantics.Returns
Truewhen a condition with the giventypeis present and itsstatusmatchesexpected_status(case-insensitive).
- saltext.kubernetes.utils._kinds.match_jsonpath(obj, path, value=None, regex=None)[source]¶
Match
objagainst a kubectl-style jsonpath.Returns
Truewhen:valueis given and the resolved value equalsvalue, ORregexis given and the stringified value matchesre.search, ORneither is given and the resolved value is truthy (existence test).
Returns
Falseif the path does not resolve.
- saltext.kubernetes.utils._kinds.build_predicate(condition=None, status='True', jsonpath=None, value=None, regex=None)[source]¶
Build a predicate callable from user-supplied wait criteria.
Exactly one of
conditionorjsonpathmust be set. The returned callable accepts a live API object and returns abool.