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

display additional columns for databaseuserreferences #27

Merged

Conversation

kperath
Copy link
Contributor

@kperath kperath commented Oct 14, 2022

Fixes #18

$ k -n my-application get databaseuserreferences
NAME                 AGE   CLUSTER NAME       USERNAME   ROLE
my-app-db-user-ref   67m   my-referenced-db   doadmin    primary

@kperath kperath requested a review from adamwg October 14, 2022 22:47
@@ -42,6 +42,10 @@ type DatabaseUserReferenceStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
//+kubebuilder:printcolumn:name="Cluster name",type=string,JSONPath=`.spec.databaseCluster.name`
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if we specify .spec.databaseCluster here rather than just the name? It would be nice to see the type as well, but I'm not sure it deserves its own column. Wondering if it will pretty-print it in a reasonable way if we just tell it to print the whole object reference.

Copy link
Contributor Author

@kperath kperath Oct 18, 2022

Choose a reason for hiding this comment

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

This is what it looks like without the name

 NAME                 AGE     CLUSTER NAME                                                                                            USERNAME   ROLE
my-app-db-user-ref   3d17h   {"apiGroup":"databases.digitalocean.com","kind":"DatabaseClusterReference","name":"my-referenced-db"}   doadmin    primary

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that's gross. Let's stick with what's already in this PR.

Copy link
Contributor

@adamwg adamwg left a comment

Choose a reason for hiding this comment

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

lgtm

@adamwg adamwg merged commit 01d0018 into main Oct 18, 2022
@adamwg adamwg deleted the kperath/additional-columns-for-database-user-references branch October 18, 2022 18:16
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.

Display additional columns by default when listing DatabaseUserReferences
2 participants