Skip to content

Commit

Permalink
fix: Resolve missing default values for Optional types in Vault config
Browse files Browse the repository at this point in the history
  • Loading branch information
blarghmatey committed Aug 3, 2023
1 parent 702dcfb commit af4fd29
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/bilder/components/hashicorp/vault/models.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit af4fd29

Please sign in to comment.