Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(k8s): add migration to SBS CSI #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2024
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
26 changes: 18 additions & 8 deletions scaleway-async/scaleway_async/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,6 @@ def unmarshal_Cluster(data: Any) -> Cluster:
if field is not None:
args["feature_gates"] = field

field = data.get("admission_plugins", None)
if field is not None:
args["admission_plugins"] = field

field = data.get("apiserver_cert_sans", None)
if field is not None:
args["apiserver_cert_sans"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand All @@ -461,6 +453,14 @@ def unmarshal_Cluster(data: Any) -> Cluster:
else:
args["auto_upgrade"] = None

field = data.get("admission_plugins", None)
if field is not None:
args["admission_plugins"] = field

field = data.get("apiserver_cert_sans", None)
if field is not None:
args["apiserver_cert_sans"] = field

field = data.get("open_id_connect_config", None)
if field is not None:
args["open_id_connect_config"] = unmarshal_ClusterOpenIDConnectConfig(field)
Expand All @@ -487,6 +487,12 @@ def unmarshal_Cluster(data: Any) -> Cluster:
else:
args["routed_ip_enabled"] = None

field = data.get("sbs_csi_enabled", None)
if field is not None:
args["sbs_csi_enabled"] = field
else:
args["sbs_csi_enabled"] = None

return Cluster(**args)


Expand Down Expand Up @@ -714,6 +720,10 @@ def unmarshal_ClusterType(data: Any) -> ClusterType:
if field is not None:
args["audit_logs_supported"] = field

field = data.get("max_etcd_size", None)
if field is not None:
args["max_etcd_size"] = field

field = data.get("commitment_delay", None)
if field is not None:
args["commitment_delay"] = field
Expand Down
30 changes: 20 additions & 10 deletions scaleway-async/scaleway_async/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,11 @@ class ClusterType:
True if the offer allows activation of the audit log functionality. Please note that audit logs are sent to Cockpit.
"""

max_etcd_size: int
"""
Maximum amount of data that can be stored in etcd for the offer.
"""

commitment_delay: Optional[str]
"""
Time period during which you can no longer switch to a lower offer.
Expand Down Expand Up @@ -812,16 +817,6 @@ class Cluster:
List of enabled feature gates.
"""

admission_plugins: List[str]
"""
List of enabled admission plugins.
"""

apiserver_cert_sans: List[str]
"""
Additional Subject Alternative Names for the Kubernetes API server certificate.
"""

created_at: Optional[datetime]
"""
Date on which the cluster was created.
Expand All @@ -842,6 +837,16 @@ class Cluster:
Auto upgrade configuration of the cluster.
"""

admission_plugins: List[str]
"""
List of enabled admission plugins.
"""

apiserver_cert_sans: List[str]
"""
Additional Subject Alternative Names for the Kubernetes API server certificate.
"""

open_id_connect_config: Optional[ClusterOpenIDConnectConfig]
"""
This configuration enables to update the OpenID Connect configuration of the Kubernetes API server.
Expand All @@ -862,6 +867,11 @@ class Cluster:
Defines whether routed IPs are enabled for nodes of this cluster.
"""

sbs_csi_enabled: Optional[bool]
"""
Defines whether the SBS-enabled CSI starting from v0.3 is installed on the cluster.
"""


@dataclass
class Node:
Expand Down
26 changes: 18 additions & 8 deletions scaleway/scaleway/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,6 @@ def unmarshal_Cluster(data: Any) -> Cluster:
if field is not None:
args["feature_gates"] = field

field = data.get("admission_plugins", None)
if field is not None:
args["admission_plugins"] = field

field = data.get("apiserver_cert_sans", None)
if field is not None:
args["apiserver_cert_sans"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand All @@ -461,6 +453,14 @@ def unmarshal_Cluster(data: Any) -> Cluster:
else:
args["auto_upgrade"] = None

field = data.get("admission_plugins", None)
if field is not None:
args["admission_plugins"] = field

field = data.get("apiserver_cert_sans", None)
if field is not None:
args["apiserver_cert_sans"] = field

field = data.get("open_id_connect_config", None)
if field is not None:
args["open_id_connect_config"] = unmarshal_ClusterOpenIDConnectConfig(field)
Expand All @@ -487,6 +487,12 @@ def unmarshal_Cluster(data: Any) -> Cluster:
else:
args["routed_ip_enabled"] = None

field = data.get("sbs_csi_enabled", None)
if field is not None:
args["sbs_csi_enabled"] = field
else:
args["sbs_csi_enabled"] = None

return Cluster(**args)


Expand Down Expand Up @@ -714,6 +720,10 @@ def unmarshal_ClusterType(data: Any) -> ClusterType:
if field is not None:
args["audit_logs_supported"] = field

field = data.get("max_etcd_size", None)
if field is not None:
args["max_etcd_size"] = field

field = data.get("commitment_delay", None)
if field is not None:
args["commitment_delay"] = field
Expand Down
30 changes: 20 additions & 10 deletions scaleway/scaleway/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,11 @@ class ClusterType:
True if the offer allows activation of the audit log functionality. Please note that audit logs are sent to Cockpit.
"""

max_etcd_size: int
"""
Maximum amount of data that can be stored in etcd for the offer.
"""

commitment_delay: Optional[str]
"""
Time period during which you can no longer switch to a lower offer.
Expand Down Expand Up @@ -812,16 +817,6 @@ class Cluster:
List of enabled feature gates.
"""

admission_plugins: List[str]
"""
List of enabled admission plugins.
"""

apiserver_cert_sans: List[str]
"""
Additional Subject Alternative Names for the Kubernetes API server certificate.
"""

created_at: Optional[datetime]
"""
Date on which the cluster was created.
Expand All @@ -842,6 +837,16 @@ class Cluster:
Auto upgrade configuration of the cluster.
"""

admission_plugins: List[str]
"""
List of enabled admission plugins.
"""

apiserver_cert_sans: List[str]
"""
Additional Subject Alternative Names for the Kubernetes API server certificate.
"""

open_id_connect_config: Optional[ClusterOpenIDConnectConfig]
"""
This configuration enables to update the OpenID Connect configuration of the Kubernetes API server.
Expand All @@ -862,6 +867,11 @@ class Cluster:
Defines whether routed IPs are enabled for nodes of this cluster.
"""

sbs_csi_enabled: Optional[bool]
"""
Defines whether the SBS-enabled CSI starting from v0.3 is installed on the cluster.
"""


@dataclass
class Node:
Expand Down