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

Add tenant field to Explorer objects #3580

Merged
merged 1 commit into from
Nov 9, 2023
Merged

Add tenant field to Explorer objects #3580

merged 1 commit into from
Nov 9, 2023

Conversation

jpellizzari
Copy link

@jpellizzari jpellizzari commented Nov 1, 2023

Closes #3299

Populates the .tenant column using the existing machinery. This is a temporary fix to get parity with existing views.
Screenshot from 2023-11-01 12-19-25

Currently, we don't have a list of namespaces stored in the database that we can easily look up.

A possible long-term solution would be to watch namespaces and store a table of namespaces and tenants for a faster lookup

@jpellizzari jpellizzari added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Nov 1, 2023
@jpellizzari jpellizzari requested review from enekofb and opudrovs and removed request for enekofb November 1, 2023 19:28
@enekofb
Copy link
Contributor

enekofb commented Nov 2, 2023

@jpellizzari could you expand what is the background problem around tenants?

( you could safely assume little knowledge on tenancy implementation details from my side 🤣 )

@jpellizzari
Copy link
Author

( you could safely assume little knowledge on tenancy implementation details from my side 🤣 )

@enekofb Same! I don't know what it is for and why someone would use it. Our docs are very sparse on this.

@jpellizzari jpellizzari force-pushed the jp-obj-tenant branch 2 times, most recently from fcaf765 to 7fa68ab Compare November 9, 2023 15:31
for _, ns := range namespaces {
if ns.GetName() == obj.Namespace {
obj.Tenant = ns.Labels["toolkit.fluxcd.io/tenant"]

Copy link
Contributor

Choose a reason for hiding this comment

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

An empty line.

And maybe we could add a break statement here?

Copy link
Author

Choose a reason for hiding this comment

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

Updated @opudrovs

@jpellizzari jpellizzari force-pushed the jp-obj-tenant branch 2 times, most recently from 9eee999 to 44bf990 Compare November 9, 2023 15:47
Copy link
Contributor

@opudrovs opudrovs left a comment

Choose a reason for hiding this comment

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

LGTM, great job! 🎉

@jpellizzari jpellizzari merged commit b307fb4 into main Nov 9, 2023
10 checks passed
@jpellizzari jpellizzari deleted the jp-obj-tenant branch November 9, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Tenant column to Explorer
3 participants