Skip to content

Add discovery client to config#612

Merged
scothis merged 2 commits intoreconcilerio:mainfrom
scothis:discovery
Apr 3, 2025
Merged

Add discovery client to config#612
scothis merged 2 commits intoreconcilerio:mainfrom
scothis:discovery

Conversation

@scothis
Copy link
Member

@scothis scothis commented Apr 1, 2025

No description provided.

Signed-off-by: Scott Andrews <scott@andrews.me>
@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 78.57143% with 6 lines in your changes missing coverage. Please review.

Project coverage is 59.65%. Comparing base (dda66e5) to head (907194d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
testing/config.go 91.66% 1 Missing and 1 partial ⚠️
reconcilers/config.go 0.00% 1 Missing ⚠️
testing/reconciler.go 0.00% 1 Missing ⚠️
testing/subreconciler.go 0.00% 1 Missing ⚠️
testing/webhook.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #612      +/-   ##
==========================================
+ Coverage   59.44%   59.65%   +0.20%     
==========================================
  Files          36       36              
  Lines        4118     4144      +26     
==========================================
+ Hits         2448     2472      +24     
- Misses       1570     1571       +1     
- Partials      100      101       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// each call to the clientset providing the ability to mutate the resource or inject an error.
WithReactors []ReactionFunc
// GivenDiscoveryResources populates the fake discovery client
GivenDiscoveryResources []*metav1.APIResourceList
Copy link
Member Author

Choose a reason for hiding this comment

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

Can we partially populate this by default from the scheme?

Copy link
Member Author

Choose a reason for hiding this comment

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

fields needs to be set in each *TestCase that ExpectConfig derives from.

c.client.PrependReactor("*", "*", reactor)
}
c.apiReader = c.createClient(apiGivenObjects, c.StatusSubResourceTypes)
c.discovery = &fakediscovery.FakeDiscovery{
Copy link
Member Author

Choose a reason for hiding this comment

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

can we power the client and apiReader RESTMapper from this discovery client?

Signed-off-by: Scott Andrews <scott@andrews.me>
@scothis scothis requested a review from mamachanko April 2, 2025 17:25
@scothis scothis marked this pull request as ready for review April 2, 2025 17:35
Copy link
Contributor

@mamachanko mamachanko left a comment

Choose a reason for hiding this comment

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

@scothis scothis merged commit ed3718e into reconcilerio:main Apr 3, 2025
4 checks passed
@scothis scothis deleted the discovery branch April 3, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants