Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/dstack/_internal/core/backends/kubernetes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class KubernetesBackendConfigWithCreds(KubernetesBackendConfig):


class KubeconfigFileConfig(CoreModel):
filename: Annotated[str, Field(description="The path to the kubeconfig file")]
filename: Annotated[str, Field(description="The path to the kubeconfig file")] = ""
data: Annotated[
Optional[str],
Field(
Expand All @@ -50,7 +50,9 @@ class KubeconfigFileConfig(CoreModel):
] = None

@root_validator
def fill_data(cls, values):
def fill_data(cls, values: dict) -> dict:
if values.get("filename") == "" and values.get("data") is None:
raise ValueError("filename or data must be specified")
return fill_data(values)


Expand Down