Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databases: support displaying URI and Created in list with format flag #1638

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

andrewsomething
Copy link
Member

In order to make the default display of doctl databases list legible in a terminal, it does not display all attributes. To achieve this, the Databases.Cols() displays different columns if Databases.Short = true. It is false when generating help output. So columns not shown are indicated as available as format options. Exposing those to Databases.ColMap() regardless of whether the sort version is used allows them to be used with the format flag while still retaining the default behavior for the list view.

Before this change, running the following command would error:

$ doctl databases list --format ID,Name,Engine,Version,URI,Created
Error: unknown column "URI"

Now it should successfully display the given fields.

@andrewsomething andrewsomething requested a review from a team January 14, 2025 18:54
Copy link

gitguardian bot commented Jan 14, 2025

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
15175723 Triggered PostgreSQL Credentials fc58239 integration/database_list_test.go View secret
15175724 Triggered MySQL Credentials fc58239 integration/database_list_test.go View secret
15175725 Triggered MySQL Credentials fc58239 integration/database_list_test.go View secret
15175726 Triggered PostgreSQL Credentials fc58239 integration/database_list_test.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Contributor

@loosla loosla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Thanks Andrew

@andrewsomething andrewsomething merged commit 34e9fbb into main Jan 14, 2025
8 checks passed
@andrewsomething andrewsomething deleted the asb/dbaas-list-format branch January 14, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants