diff --git a/doc/architecture/Domain.md b/doc/architecture/Domain.md index 9a59a4c..fa18bc7 100644 --- a/doc/architecture/Domain.md +++ b/doc/architecture/Domain.md @@ -25,6 +25,16 @@ classDiagram c4k_executabel_name c4k_mixin_config c4k_mixin_auth + c4k_grafana_cloud_user + c4k_grafana_cloud_password + } + + class ProvsK3s { + k3s_provision_user + k3s_letsencrypt_email + k3s_letsencrypt_endpoint + k3s_enable_echo + k3s_app_filename_to_provision } class DnsRecord { @@ -71,11 +81,13 @@ classDiagram Devops *-- "0..1" Image: spcialized_builds Devops *-- "0..1" C4k: spcialized_builds + Devops *-- "0..1" ProvsK3s: spcialized_builds Devops *-- "0..1" Release: mixins Release o-- "0..1" BuildFile: primary_build_file Release o-- "0..n" BuildFile: secondary_build_files BuildFile *-- "1" Version - C4k *-- DnsRecord + C4k *-- DnsRecord: dns_record + ProvsK3s *-- DnsRecord: provision_dns Credentials *-- "0..n" CredentialMapping: mappings ``` diff --git a/src/main/python/ddadevops/domain/__init__.py b/src/main/python/ddadevops/domain/__init__.py index 0378707..022e38f 100644 --- a/src/main/python/ddadevops/domain/__init__.py +++ b/src/main/python/ddadevops/domain/__init__.py @@ -2,6 +2,7 @@ from .common import Validateable, DnsRecord, Devops, BuildType, MixinType, Relea from .devops_factory import DevopsFactory from .image import Image from .c4k import C4k +from .provs_k3s import K3s from .release import Release from .credentials import Credentials, CredentialMapping, GopassType from .version import Version diff --git a/src/main/python/ddadevops/domain/common.py b/src/main/python/ddadevops/domain/common.py index 3eb17a2..946c1c3 100644 --- a/src/main/python/ddadevops/domain/common.py +++ b/src/main/python/ddadevops/domain/common.py @@ -9,6 +9,7 @@ def filter_none(list_to_filter): class BuildType(Enum): IMAGE = 0 C4K = 1 + K3S = 2 class MixinType(Enum): diff --git a/src/main/python/ddadevops/domain/devops_factory.py b/src/main/python/ddadevops/domain/devops_factory.py index 48d1089..556348c 100644 --- a/src/main/python/ddadevops/domain/devops_factory.py +++ b/src/main/python/ddadevops/domain/devops_factory.py @@ -2,6 +2,7 @@ from typing import List, Optional, Dict from .common import Validateable, Devops, BuildType, MixinType from .image import Image from .c4k import C4k +from .provs_k3s import K3s from .release import Release from .version import Version @@ -19,6 +20,8 @@ class DevopsFactory: specialized_builds[BuildType.IMAGE] = Image(inp) if BuildType.C4K in build_types: specialized_builds[BuildType.C4K] = C4k(inp) + if BuildType.K3S in build_types: + specialized_builds[BuildType.K3S] = K3s(inp) mixins: Dict[MixinType, Validateable] = {} if MixinType.RELEASE in mixin_types: diff --git a/src/main/python/ddadevops/domain/provs_k3s.py b/src/main/python/ddadevops/domain/provs_k3s.py new file mode 100644 index 0000000..9a746d4 --- /dev/null +++ b/src/main/python/ddadevops/domain/provs_k3s.py @@ -0,0 +1,10 @@ +from typing import List, Optional +from .common import ( + Validateable, + DnsRecord, + Devops, +) + +class K3s(Validateable): + def __init__(self, inp: dict): + pass \ No newline at end of file diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 3c6fdd0..d9cc9cf 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -9,7 +9,7 @@ def devops_config(overrides: dict) -> dict: "stage": "test", "project_root_path": "root_path", "build_dir_name": "target", - "build_types": ["IMAGE", "C4K"], + "build_types": ["IMAGE", "C4K", "K3S"], "mixin_types": ["RELEASE"], "image_dockerhub_user": "dockerhub_user", "image_dockerhub_password": "dockerhub_password", diff --git a/src/test/python/domain/test_provs_k3s.py b/src/test/python/domain/test_provs_k3s.py new file mode 100644 index 0000000..be81e0e --- /dev/null +++ b/src/test/python/domain/test_provs_k3s.py @@ -0,0 +1,13 @@ +import pytest +from pathlib import Path +from src.main.python.ddadevops.domain import ( + DnsRecord, + BuildType, + K3s +) +from .helper import build_devops + + +def test_creation(): + sut = build_devops({}) + assert BuildType.K3S in sut.specialized_builds