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 owner-name label on resources #3608

Merged
merged 8 commits into from
Dec 5, 2023
Merged

Conversation

super-harsh
Copy link
Collaborator

@super-harsh super-harsh commented Nov 28, 2023

Closes #3190
What this PR does / why we need it:

This PR enables controller to add serviceoperator.azure.com/owner-name: <OwnerName> label at the time of adding the initial resource state

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (f6ab7ee) 53.08% compared to head (d33d1a6) 53.27%.
Report is 10 commits behind head on main.

Files Patch % Lines
v2/pkg/genruntime/base_types.go 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3608      +/-   ##
==========================================
+ Coverage   53.08%   53.27%   +0.19%     
==========================================
  Files        1286     1340      +54     
  Lines      406699   438163   +31464     
==========================================
+ Hits       215894   233431   +17537     
- Misses     159804   170240   +10436     
- Partials    31001    34492    +3491     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@matthchr matthchr left a comment

Choose a reason for hiding this comment

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

Users can't filter w/ annotations I don't think, only with labels?

So I think this needs to be a label not an annotation.


const (
PerResourceSecret = "serviceoperator.azure.com/credential-from"
OwnedByAnnotation = "serviceoperator.azure.com/owned-by"
Copy link
Member

Choose a reason for hiding this comment

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

I think owner-name or owner would be clearer than owned-by.

Do we also need to think about owner-group-kind or something as well, for extension resources such as roleassignment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep makes sense - Users can filter through annotations but isn't as easy as with labels.
Made the changes to add label instead of annotation and changes the name to owned-by to owner-name.

Not very sure about if adding owner-group-kind would bring much value.. since user can anyway filter based on owner-name - which is more specific rather than filtering all resources based on just group + kind?

Copy link
Member

Choose a reason for hiding this comment

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

Not having owner-group-kind forces the user to do another query to discover the owner type if they don't already know it. I think there's value in making it easy/obvious.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure! and that applies to only resources which are KubernetesReferences?

@super-harsh super-harsh changed the title Add owned-by annotation on resources Add owner-name label on resources Nov 30, 2023
@super-harsh super-harsh added this to the v2.5.0 milestone Dec 4, 2023
@matthchr matthchr added this pull request to the merge queue Dec 5, 2023
Merged via the queue into main with commit 122dd82 Dec 5, 2023
8 checks passed
@matthchr matthchr deleted the feature/owned-by-annotation branch December 5, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Support finding child resources easier with automatic label additions?
4 participants