Changeset View
Changeset View
Standalone View
Standalone View
python_modules/automation/automation/helm/schema/definitions.py
- This file was copied from python_modules/automation/automation/helm/schema/kubernetes.py.
from enum import Enum | from enum import Enum | ||||
from pydantic import BaseModel, Extra # pylint: disable=E0611 | from pydantic import BaseModel # pylint: disable=E0611 | ||||
from .utils import SupportedKubernetes, create_definition_ref | from .utils import create_definition_ref | ||||
class PullPolicy(str, Enum): | class PullPolicy(str, Enum): | ||||
ALWAYS = "Always" | ALWAYS = "Always" | ||||
IF_NOT_PRESENT = "IfNotPresent" | IF_NOT_PRESENT = "IfNotPresent" | ||||
NEVER = "Never" | NEVER = "Never" | ||||
class Image(BaseModel): | class Image(BaseModel): | ||||
repository: str | repository: str | ||||
tag: str | tag: str | ||||
pullPolicy: PullPolicy | pullPolicy: PullPolicy | ||||
class Config: | |||||
extra = Extra.forbid | class Kubernetes(BaseModel): | ||||
image: Image | |||||
class Service(BaseModel): | class Service(BaseModel): | ||||
type: str | type: str | ||||
port: int | port: int | ||||
class Config: | |||||
extra = Extra.forbid | |||||
class NodeSelector(BaseModel): | class NodeSelector(BaseModel): | ||||
class Config: | class Config: | ||||
schema_extra = { | schema_extra = { | ||||
"$ref": create_definition_ref("io.k8s.api.core.v1.PodSpec/properties/nodeSelector") | "$ref": create_definition_ref("io.k8s.api.core.v1.PodSpec/properties/nodeSelector") | ||||
} | } | ||||
Show All 30 Lines | class Config: | ||||
"$ref": create_definition_ref("io.k8s.api.core.v1.Container/properties/livenessProbe") | "$ref": create_definition_ref("io.k8s.api.core.v1.Container/properties/livenessProbe") | ||||
} | } | ||||
class StartupProbe(BaseModel): | class StartupProbe(BaseModel): | ||||
class Config: | class Config: | ||||
schema_extra = { | schema_extra = { | ||||
"$ref": create_definition_ref( | "$ref": create_definition_ref( | ||||
"io.k8s.api.core.v1.Container/properties/startupProbe", | "io.k8s.api.core.v1.Container/properties/startupProbe", version="1.16.0" | ||||
version=SupportedKubernetes.V1_16, | |||||
) | ) | ||||
} | } |