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

Modify Pre/Post-Reconciliation Extensions to provide a Resolver #3105

Merged
merged 8 commits into from
Jul 3, 2023

Conversation

theunrepentantgeek
Copy link
Member

@theunrepentantgeek theunrepentantgeek commented Jun 27, 2023

What this PR does / why we need it:

The two extension points PreReconciliationChecker and PostReconciliationChecker provide numerous parameters to enable extension implementations to easily achieve their goals.

We passed through a kubeclient.Client by design, but have found this to be difficult to consume because our resources often have a genruntime.ResourceReference but kubeclient.Client requires a GVK.

Replacing kubeclient.Client with resolver.Resolver bridges this gap, allowing extension implementers to simply call ResolveReference() and not fuss with GVK (etc).

Closes #3092

How does this PR make you feel:
gif

@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2023

Codecov Report

Merging #3105 (56ff069) into main (d882264) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3105      +/-   ##
==========================================
+ Coverage   54.23%   54.25%   +0.01%     
==========================================
  Files        1418     1418              
  Lines      609010   609010              
==========================================
+ Hits       330312   330432     +120     
+ Misses     224596   224472     -124     
- Partials    54102    54106       +4     
Impacted Files Coverage Δ
...rvice/customizations/managed_cluster_extensions.go 65.15% <ø> (ø)
...izations/managed_clusters_agent_pool_extensions.go 43.47% <ø> (ø)
...resql/customizations/flexible_server_extensions.go 64.28% <ø> (ø)
...omizations/flexible_servers_database_extensions.go 22.22% <ø> (ø)
...tions/flexible_servers_firewall_rule_extensions.go 44.44% <ø> (ø)
...ork/customizations/private_endpoints_extensions.go 29.41% <ø> (ø)
...ilers/arm/azure_generic_arm_reconciler_instance.go 68.88% <100.00%> (ø)
...enruntime/extensions/postreconciliation_checker.go 48.83% <100.00%> (ø)
...genruntime/extensions/prereconciliation_checker.go 50.00% <100.00%> (ø)

... and 27 files with indirect coverage changes

@@ -8,6 +8,7 @@ package customizations
import (
"context"
"fmt"
"github.com/Azure/azure-service-operator/v2/internal/resolver"
Copy link
Member

Choose a reason for hiding this comment

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

minor: import ordering

Copy link
Member

Choose a reason for hiding this comment

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

And in other files

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@theunrepentantgeek theunrepentantgeek enabled auto-merge (squash) July 3, 2023 04:18
@theunrepentantgeek theunrepentantgeek merged commit d505950 into main Jul 3, 2023
@theunrepentantgeek theunrepentantgeek deleted the feature/reconciliation-extensions branch July 3, 2023 04:53
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.

Improve the Prereconciliation extension point
4 participants