grafana / tanka

Flexible, reusable and concise configuration for Kubernetes
https://tanka.dev
Apache License 2.0
2.39k stars 165 forks source link

prune failing when unable to list resources in all namespaces #327

Closed retzkek closed 4 years ago

retzkek commented 4 years ago

In the same vein as #301, tk prune is failing when running on an OKD/OpenShift cluster, since it's trying to list resources in all namespaces, which I can't do. Specifically in kubernetes.Orphaned() at https://github.com/grafana/tanka/blob/e5556f1c851bcfe2f0ec885896642d7c418c692f/pkg/kubernetes/apply.go#L63 (that first empty string tells GetByLabels() to add --all-namespaces instead of a specific namespace)

Maybe a fix for this could also solve #326?

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label kind/bug to this issue, with a confidence of 0.98. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

paul-bormans-pcgw commented 2 months ago

Hit the same issue but now on a Google managed platform. Some resources you simply do not have access to as these are managed. It would be nice to reduce the namespaces and resource/apigroups to be considered. So either specify an --include or an --exclude (or both ;-))