diff --git a/scaleway-async/scaleway_async/k8s/v1/__init__.py b/scaleway-async/scaleway_async/k8s/v1/__init__.py index c62adde16..b3e69abe7 100644 --- a/scaleway-async/scaleway_async/k8s/v1/__init__.py +++ b/scaleway-async/scaleway_async/k8s/v1/__init__.py @@ -21,6 +21,7 @@ from .types import MaintenanceWindow from .types import CoreV1Taint from .types import CreateClusterRequestPoolConfigUpgradePolicy +from .types import ComponentInfo from .types import ClusterAutoUpgrade from .types import ClusterAutoscalerConfig from .types import ClusterOpenIDConnectConfig @@ -113,6 +114,7 @@ "MaintenanceWindow", "CoreV1Taint", "CreateClusterRequestPoolConfigUpgradePolicy", + "ComponentInfo", "ClusterAutoUpgrade", "ClusterAutoscalerConfig", "ClusterOpenIDConnectConfig", diff --git a/scaleway-async/scaleway_async/k8s/v1/marshalling.py b/scaleway-async/scaleway_async/k8s/v1/marshalling.py index e39e13480..5587b459e 100644 --- a/scaleway-async/scaleway_async/k8s/v1/marshalling.py +++ b/scaleway-async/scaleway_async/k8s/v1/marshalling.py @@ -22,6 +22,7 @@ PoolStatus, PoolVolumeType, Runtime, + ComponentInfo, Version, MaintenanceWindow, ClusterAutoUpgrade, @@ -73,6 +74,23 @@ ) +def unmarshal_ComponentInfo(data: Any) -> ComponentInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ComponentInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("version", None) + if field is not None: + args["version"] = field + else: + args["version"] = None + + return ComponentInfo(**args) + + def unmarshal_Version(data: Any) -> Version: if not isinstance(data, dict): raise TypeError( @@ -131,6 +149,16 @@ def unmarshal_Version(data: Any) -> Version: else: args["available_kubelet_args"] = {} + field = data.get("additional_components", None) + if field is not None: + args["additional_components"] = ( + {key: unmarshal_ComponentInfo(value) for key, value in field.items()} + if field is not None + else None + ) + else: + args["additional_components"] = {} + field = data.get("deprecated_at", None) if field is not None: args["deprecated_at"] = ( diff --git a/scaleway-async/scaleway_async/k8s/v1/types.py b/scaleway-async/scaleway_async/k8s/v1/types.py index 177043f22..6bb6affd0 100644 --- a/scaleway-async/scaleway_async/k8s/v1/types.py +++ b/scaleway-async/scaleway_async/k8s/v1/types.py @@ -40,8 +40,6 @@ class CNI(str, Enum, metaclass=StrEnumMeta): UNKNOWN_CNI = "unknown_cni" CILIUM = "cilium" CALICO = "calico" - WEAVE = "weave" - FLANNEL = "flannel" KILO = "kilo" NONE = "none" CILIUM_NATIVE = "cilium_native" @@ -198,9 +196,7 @@ def __str__(self) -> str: class Runtime(str, Enum, metaclass=StrEnumMeta): UNKNOWN_RUNTIME = "unknown_runtime" - DOCKER = "docker" CONTAINERD = "containerd" - CRIO = "crio" def __str__(self) -> str: return str(self.value) @@ -254,6 +250,11 @@ class CreateClusterRequestPoolConfigUpgradePolicy: """ +@dataclass +class ComponentInfo: + version: str + + @dataclass class ClusterAutoUpgrade: enabled: bool @@ -753,6 +754,11 @@ class Version: Supported kubelet arguments for this version. """ + additional_components: dict[str, ComponentInfo] + """ + Map containing every sub-component version shipped with this Kapsule version. + """ + deprecated_at: Optional[datetime] = None """ Date from which this version will no longer be available for provisioning. diff --git a/scaleway/scaleway/k8s/v1/__init__.py b/scaleway/scaleway/k8s/v1/__init__.py index c62adde16..b3e69abe7 100644 --- a/scaleway/scaleway/k8s/v1/__init__.py +++ b/scaleway/scaleway/k8s/v1/__init__.py @@ -21,6 +21,7 @@ from .types import MaintenanceWindow from .types import CoreV1Taint from .types import CreateClusterRequestPoolConfigUpgradePolicy +from .types import ComponentInfo from .types import ClusterAutoUpgrade from .types import ClusterAutoscalerConfig from .types import ClusterOpenIDConnectConfig @@ -113,6 +114,7 @@ "MaintenanceWindow", "CoreV1Taint", "CreateClusterRequestPoolConfigUpgradePolicy", + "ComponentInfo", "ClusterAutoUpgrade", "ClusterAutoscalerConfig", "ClusterOpenIDConnectConfig", diff --git a/scaleway/scaleway/k8s/v1/marshalling.py b/scaleway/scaleway/k8s/v1/marshalling.py index e39e13480..5587b459e 100644 --- a/scaleway/scaleway/k8s/v1/marshalling.py +++ b/scaleway/scaleway/k8s/v1/marshalling.py @@ -22,6 +22,7 @@ PoolStatus, PoolVolumeType, Runtime, + ComponentInfo, Version, MaintenanceWindow, ClusterAutoUpgrade, @@ -73,6 +74,23 @@ ) +def unmarshal_ComponentInfo(data: Any) -> ComponentInfo: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'ComponentInfo' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("version", None) + if field is not None: + args["version"] = field + else: + args["version"] = None + + return ComponentInfo(**args) + + def unmarshal_Version(data: Any) -> Version: if not isinstance(data, dict): raise TypeError( @@ -131,6 +149,16 @@ def unmarshal_Version(data: Any) -> Version: else: args["available_kubelet_args"] = {} + field = data.get("additional_components", None) + if field is not None: + args["additional_components"] = ( + {key: unmarshal_ComponentInfo(value) for key, value in field.items()} + if field is not None + else None + ) + else: + args["additional_components"] = {} + field = data.get("deprecated_at", None) if field is not None: args["deprecated_at"] = ( diff --git a/scaleway/scaleway/k8s/v1/types.py b/scaleway/scaleway/k8s/v1/types.py index 177043f22..6bb6affd0 100644 --- a/scaleway/scaleway/k8s/v1/types.py +++ b/scaleway/scaleway/k8s/v1/types.py @@ -40,8 +40,6 @@ class CNI(str, Enum, metaclass=StrEnumMeta): UNKNOWN_CNI = "unknown_cni" CILIUM = "cilium" CALICO = "calico" - WEAVE = "weave" - FLANNEL = "flannel" KILO = "kilo" NONE = "none" CILIUM_NATIVE = "cilium_native" @@ -198,9 +196,7 @@ def __str__(self) -> str: class Runtime(str, Enum, metaclass=StrEnumMeta): UNKNOWN_RUNTIME = "unknown_runtime" - DOCKER = "docker" CONTAINERD = "containerd" - CRIO = "crio" def __str__(self) -> str: return str(self.value) @@ -254,6 +250,11 @@ class CreateClusterRequestPoolConfigUpgradePolicy: """ +@dataclass +class ComponentInfo: + version: str + + @dataclass class ClusterAutoUpgrade: enabled: bool @@ -753,6 +754,11 @@ class Version: Supported kubelet arguments for this version. """ + additional_components: dict[str, ComponentInfo] + """ + Map containing every sub-component version shipped with this Kapsule version. + """ + deprecated_at: Optional[datetime] = None """ Date from which this version will no longer be available for provisioning.