-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix: expand tenant view output #174
Conversation
pkg/cmd/tenant/list/list.go
Outdated
|
||
func getEnvironmentMap(client *client.Client) (map[string]string, error) { | ||
environmentMap := make(map[string]string) | ||
allEnvs, err := client.Environments.GetAll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid GetAll
. It does not scale. Is there any way of getting this information from another API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point, I can modify it to find all the ids it needs and call the query endpoint with a list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, which endpoint can we use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can filter by a list of id values
api/Spaces-1/environments?ids=Environments-1,Environments-282
pkg/cmd/tenant/list/list.go
Outdated
|
||
func getProjectMap(client *client.Client) (map[string]string, error) { | ||
projectMap := make(map[string]string) | ||
allEnvs, err := client.Projects.GetAll() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid GetAll
. It does not scale. Is there any way of getting this information from another API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, in the api for all resources when you do client.Projects.Get()
on the returned struct you can use the .GetAllPages()
function to get all.
This change is to support filtering tenants by tag using
jq
json before:
json after:
TenantTags
field is marked asomitempty
so an empty array ends up being left out. Previously we were ending up with the default values of an empty array in the json, making the contract more stable.table before:
table after: