From af4fd295f548c2e70876c506983b0318ce94dd5b Mon Sep 17 00:00:00 2001 From: Tobias Macey Date: Thu, 3 Aug 2023 13:53:01 -0400 Subject: [PATCH] fix: Resolve missing default values for Optional types in Vault config --- src/bilder/components/hashicorp/vault/models.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bilder/components/hashicorp/vault/models.py b/src/bilder/components/hashicorp/vault/models.py index 3148aa8a9..c96d3cc9b 100644 --- a/src/bilder/components/hashicorp/vault/models.py +++ b/src/bilder/components/hashicorp/vault/models.py @@ -1,10 +1,9 @@ import abc from collections.abc import Iterable from pathlib import Path -from typing import Optional, Union +from typing import Annotated, Optional, Union -from pydantic import SerializeAsAny, field_validator -from pydantic.types import conint +from pydantic import Field, SerializeAsAny, field_validator from pydantic_settings import SettingsConfigDict from bilder.components.hashicorp.models import ( @@ -126,7 +125,7 @@ class VaultRetryJoin(FlexibleBaseModel): class IntegratedRaftStorageBackend(FlexibleBaseModel): path: Path = Path("/var/lib/vault/raft/") - performance_multiplier: Optional[conint(ge=0, le=10)] # type: ignore + performance_multiplier: Optional[Annotated[int, Field(ge=0, le=10)]] = None # The node_id is an optional parameter that will receive an autogenerated UUID if # not set. # https://github.com/hashicorp/vault/blob/master/physical/raft/raft.go#L289-L329