-
Notifications
You must be signed in to change notification settings - Fork 705
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
Postrenderer support resourcelists #1680
Postrenderer support resourcelists #1680
Conversation
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.
LGTM but I would just check if the resource has the key items
to know if it's a list
"PodTemplateList": struct{}{}, | ||
"ReplicaSetList": struct{}{}, | ||
"ReplicationControllerList": struct{}{}, | ||
"StatefulSetList": struct{}{}, |
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.
AFAIK, just "List"
is also a valid resource type
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.
As far as I know, this is only used for the top level which the renderer never sees, but I've added it anyway.
if _, ok := resourceListTypes[kind]; ok { | ||
if items, ok := resource["items"]; ok { |
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.
can't we just check if the resource has the key "items"
to know if it's a list? That may be a slightly slower (since we would be processing list for other than workloads) but safer and we would need to maintain less hard-coded types.
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 could, and it would work now. I thought it better to be explicit, since we don't control the API, but perhaps it would be simpler. Updating.
Based on feedback from previous PR, this updates to handle both CronJobs and all resource list types.
Ref: #1617