feat: implements a better kubernetes deployment setup

This commit is contained in:
2025-11-08 19:59:07 -03:00
parent 114cc99a52
commit c615a71277
12 changed files with 184 additions and 42 deletions

View File

@@ -37,12 +37,15 @@ def build_client_s3(config: dict) -> botocore.client.BaseClient:
def dependency_storage_service() -> StorageService:
load_dotenv()
if StorageType(os.environ["STORAGE_TYPE"]) == StorageType.S3_STORAGE:
s3_config = get_config_s3()
storage_type = StorageType(os.environ.get("STORAGE_TYPE", "s3"))
return AmazonS3Service(
build_client_s3(s3_config),
s3_config["bucket_name"],
)
match storage_type:
case StorageType.S3_STORAGE:
s3_config = get_config_s3()
raise RuntimeError("Invalid Storage Type")
return AmazonS3Service(
build_client_s3(s3_config),
s3_config["bucket_name"],
)
case _:
raise RuntimeError("Invalid Storage Type")

View File

@@ -23,12 +23,9 @@ from functools import cache
def dependency_virus_checker_service() -> VirusCheckerService:
load_dotenv()
try:
type = VirusCheckerType(os.environ["VIRUS_CHECKER_TYPE"])
except ValueError:
raise RuntimeError("Invalid Virus Checker Type")
checker_type = VirusCheckerType(os.environ.get("VIRUS_CHECKER_TYPE", "total_virus"))
match type:
match checker_type:
case VirusCheckerType.TOTAL_VIRUS:
virus_checker = Virustotal(get_virus_checker_api_key())
return VirusTotalService(virus_checker)