Skip to content

Commit

Permalink
fix(secret): corrects corresponding list functions (#310)
Browse files Browse the repository at this point in the history
Due to a recent refactor in the v2 client library,
the list secrets function now returns the entire
secret objects instead of just reading the metadata
in the previous implementation. This changed object
altogther and the way other sections of code fetched
the secret name.

This commit addresses the issue by correcting the
list_secrets function.
  • Loading branch information
RomilShah authored May 20, 2024
1 parent 0ac9988 commit 34b5c0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions riocli/secret/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def list_secrets() -> None:
try:
client = new_v2_client(with_project=True)
secrets = client.list_secrets()
secrets = sorted(secrets, key=lambda s: s.name.lower())
secrets = sorted(secrets, key=lambda s: s.metadata.name.lower())
_display_secret_list(secrets, show_header=True)
except Exception as e:
click.secho(str(e), fg=Colors.RED)
Expand All @@ -49,7 +49,7 @@ def _display_secret_list(
if show_header:
headers = ('ID', 'Name', 'Created At', 'Creator')

data = [ [secret.guid, secret.name,
secret.createdAt, secret.creatorGUID] for secret in secrets ]
data = [ [secret.metadata.guid, secret.metadata.name,
secret.metadata.createdAt, secret.metadata.creatorGUID] for secret in secrets ]

tabulate_data(data, headers)

0 comments on commit 34b5c0b

Please sign in to comment.