Skip to content

Commit

Permalink
feat(cli): allow selecting default profile in ~/.silverback/profile.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Aug 2, 2024
1 parent c1df33c commit 44b5059
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion silverback/_click_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_profile(ctx: click.Context, param, value) -> BaseProfile:
"--profile",
"profile",
metavar="PROFILE",
default=DEFAULT_PROFILE,
default=settings.default_profile,
callback=get_profile,
expose_value=expose_value,
is_eager=True, # NOTE: Required to ensure that `profile` is always set, even if not provied
Expand Down
1 change: 1 addition & 0 deletions silverback/cluster/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class ProfileSettings(BaseModel):

auth: dict[str, AuthenticationConfig]
profile: dict[str, PlatformProfile | ClusterProfile]
default_profile: str = Field(default=DEFAULT_PROFILE, alias="default-profile")

@model_validator(mode="after")
def ensure_auth_exists_for_profile(self) -> Self:
Expand Down

0 comments on commit 44b5059

Please sign in to comment.