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

Rework how resources are calculated #3238

Merged
merged 5 commits into from
Jan 27, 2025

Conversation

aruiz14
Copy link
Contributor

@aruiz14 aruiz14 commented Jan 22, 2025

Refers to #3186

This PR concludes the work started on #3203 and #3209, by refactoring how the status.resources (and especially perClusterState) are calculated.
The goal of this refactor is to keep all the information accessible, while still producing the same opinionated representation. This will allow to later change the format in an easier way, or adding new fields from the same information (e.g. PerClusterResources).

@aruiz14 aruiz14 requested a review from a team as a code owner January 22, 2025 16:01
Comment on lines +177 to +178
// "Ready" states are currently omitted
if entry.State == "Ready" {
continue
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I mentioned in the description about perClusterState being opinionated, this is one of the causes: Ready resources are omitted from this view (and that forces the UI to use BundleDeployments for displaying GitRepo resources BTW). If we wanted to change that, it would be as simple as removing these lines.

internal/resourcestatus/resourcekey_test.go Outdated Show resolved Hide resolved
internal/resourcestatus/resourcekey.go Outdated Show resolved Hide resolved
@kkaempf kkaempf added this to the v2.11.0 milestone Jan 23, 2025
@aruiz14 aruiz14 force-pushed the rework-gitrepo-status-resources branch from f06827f to 4f0cde5 Compare January 24, 2025 10:34
@aruiz14 aruiz14 requested a review from weyfonk January 24, 2025 10:34
Copy link
Contributor

@weyfonk weyfonk left a comment

Choose a reason for hiding this comment

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

Nice one, thanks! LGTM

@kkaempf
Copy link
Collaborator

kkaempf commented Jan 27, 2025

Would we need to adapt UI for this ?

@aruiz14
Copy link
Contributor Author

aruiz14 commented Jan 27, 2025

Would we need to adapt UI for this ?

@kkaempf no, no change is needed. It only changes how the info is calculated internally, while still producing the same result

@aruiz14 aruiz14 merged commit 2515936 into rancher:main Jan 27, 2025
12 checks passed
@aruiz14 aruiz14 deleted the rework-gitrepo-status-resources branch January 27, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants