-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat(tenant): add label with tenant name for each tenant #910
feat(tenant): add label with tenant name for each tenant #910
Conversation
✅ Deploy Preview for capsule-documentation canceled.
|
10b16fd
to
1a6d7f8
Compare
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.
I dunno why we would need a new recipe, lint
when we already have golint
.
controllers/tenant/metadata.go
Outdated
tnt.SetLabels(map[string]string{ | ||
TenantNameLabel: tnt.Name, | ||
}) |
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 keep the already existing labels, otherwise, we're gonna overwrite the user ones.
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.
I don't agree, using capsule specific labels seems like we are creating just a technical dept for the future. You could say the same thing here, no?
#911
I would prefer using a well-known label here as well.
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.
I didn't explain properly, here.
Let's say I have a Tenant:
NAME STATE NAMESPACE QUOTA NAMESPACE COUNT NODE SELECTOR AGE
solar Active 0 15s
I'm labelling it for several reasons:
$: kubectl label tnt solar my-label=value
tenant.capsule.clastix.io/solar labeled
$: kubectl get tnt --show-labels
NAME STATE NAMESPACE QUOTA NAMESPACE COUNT NODE SELECTOR AGE LABELS
solar Active 0 49s my-label=value
With the tnt.SetLabels
provided by your code we're gonna overwrite the user labels, such as my-label
.
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.
@prometherion Ah right, sorry for the missunderstanding!
fedd606
to
298e2ba
Compare
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.
Tried to play around with pre-commit. But it's annoying. Removed the target.
controllers/tenant/metadata.go
Outdated
tnt.SetLabels(map[string]string{ | ||
TenantNameLabel: tnt.Name, | ||
}) |
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.
I don't agree, using capsule specific labels seems like we are creating just a technical dept for the future. You could say the same thing here, no?
#911
I would prefer using a well-known label here as well.
Tests are failing but they should have been fixed with the latest commits on |
def6471
to
8b62da9
Compare
Signed-off-by: Oliver Bähler <[email protected]>
8b62da9
to
c44aba2
Compare
@prometherion I have extend it with a webhook, otherwise there could be potential for escalation between the time of an update and a reconcile. I hope that's alright. |
Initial efforts for the implementation of:
projectcapsule/capsule-proxy#328