Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scaleway-async/scaleway_async/k8s/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,6 +114,7 @@
"MaintenanceWindow",
"CoreV1Taint",
"CreateClusterRequestPoolConfigUpgradePolicy",
"ComponentInfo",
"ClusterAutoUpgrade",
"ClusterAutoscalerConfig",
"ClusterOpenIDConnectConfig",
Expand Down
28 changes: 28 additions & 0 deletions scaleway-async/scaleway_async/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
PoolStatus,
PoolVolumeType,
Runtime,
ComponentInfo,
Version,
MaintenanceWindow,
ClusterAutoUpgrade,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"] = (
Expand Down
14 changes: 10 additions & 4 deletions scaleway-async/scaleway_async/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -254,6 +250,11 @@ class CreateClusterRequestPoolConfigUpgradePolicy:
"""


@dataclass
class ComponentInfo:
version: str


@dataclass
class ClusterAutoUpgrade:
enabled: bool
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions scaleway/scaleway/k8s/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -113,6 +114,7 @@
"MaintenanceWindow",
"CoreV1Taint",
"CreateClusterRequestPoolConfigUpgradePolicy",
"ComponentInfo",
"ClusterAutoUpgrade",
"ClusterAutoscalerConfig",
"ClusterOpenIDConnectConfig",
Expand Down
28 changes: 28 additions & 0 deletions scaleway/scaleway/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
PoolStatus,
PoolVolumeType,
Runtime,
ComponentInfo,
Version,
MaintenanceWindow,
ClusterAutoUpgrade,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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"] = (
Expand Down
14 changes: 10 additions & 4 deletions scaleway/scaleway/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -254,6 +250,11 @@ class CreateClusterRequestPoolConfigUpgradePolicy:
"""


@dataclass
class ComponentInfo:
version: str


@dataclass
class ClusterAutoUpgrade:
enabled: bool
Expand Down Expand Up @@ -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.
Expand Down
Loading