[FE]: Add label & annotation to the auto-generated RemoteUserBinding
to inform that it is managed by syngit
#45
Labels
RemoteUserBinding
to inform that it is managed by syngit
#45
Roadmap 2025/01 Add label & annotation to the auto-generated
RemoteUserBinding
to inform that it is managed by Syngit.As the developer of my team, I want to make the difference between RemoteUserBindings that have been automatically generated (with the
syngit.io/associated-remote-userbinding: "true"
annotation) and those who have not. I want to make the difference using a specific label.What to do
When creating the auto-generated
RemoteUserBinding
, add the labelsmanaged-by: syngit.io
&syngit.io/k8s-user: username
. Also, add the annotationsyngit.io/controlled-by: webhook/remoteuser-association
.syngit/internal/webhook/v1beta2/remoteuser_association_webhook.go
Lines 59 to 61 in 8442bb1
The username variable already exists here:
syngit/internal/webhook/v1beta2/remoteuser_association_webhook.go
Line 28 in 8442bb1
After setting the remoteRefs and before updating the
RemoteUserBinding
.syngit/internal/webhook/v1beta2/remoteuser_association_webhook.go
Lines 93 to 95 in 8442bb1
Set the `syngit.io/controlled-by: webhook/remoteuser-association annotation again. Since the annotations fields is defined as a map, it will either add it to the map (is removed by the user) or replace the old value (which was the exact same).
Additional context
If you have any questions, please tag @damsien.
The text was updated successfully, but these errors were encountered: