Skip to content

Commit

Permalink
transform: update typing for Kubernetes 1.24
Browse files Browse the repository at this point in the history
available_replicas being non-optional is considered a bug, which has
been fixed in 1.24, see
kubernetes/kubernetes#109241

CMK-10232

Change-Id: Id27543e90e6ea6e2cfffc010f98e7b5371c1dabf
  • Loading branch information
SoloJacobs authored and jplitza committed Aug 23, 2022
1 parent 869e117 commit 000963b
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions cmk/special_agents/utils_kubernetes/transform_json.py
Expand Up @@ -91,22 +91,12 @@ class JSONStatefulSetSpec(TypedDict):
updateStrategy: JSONStatefulSetUpdateStrategy


class JSONStatefulSetStatusBelow23(TypedDict, total=False):
class JSONStatefulSetStatus(TypedDict, total=False):
readyReplicas: int
updatedReplicas: int


class JSONStatefulSetStatusAt23Mandatory(TypedDict):
availableReplicas: int


class JSONStatefulSetStatusAt23(JSONStatefulSetStatusAt23Mandatory, JSONStatefulSetStatusBelow23):
pass


JSONStatefulSetStatus = Union[JSONStatefulSetStatusAt23, JSONStatefulSetStatusBelow23]


class JSONStatefulSet(TypedDict):
metadata: JSONStatefulSetMetaData
spec: JSONStatefulSetSpec
Expand Down

0 comments on commit 000963b

Please sign in to comment.