-
Notifications
You must be signed in to change notification settings - Fork 215
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
feat: allow users to opt-in to direct reconciliation #2645
feat: allow users to opt-in to direct reconciliation #2645
Conversation
WIP because I think this presumes that all controllers are TF & Direct. cc @yuwenma |
@justinsb seems there is some code missing? It doesn't compile. |
a95e33d
to
b9710f7
Compare
Should we update k8s-config-connector/pkg/test/resourcefixture/contexts/register.go Lines 94 to 105 in 1ed7c14
|
|
||
var _ kccpredicate.ReconcileGate = &SQLInstanceReconcileGate{} | ||
|
||
func (*SQLInstanceReconcileGate) ShouldReconcile(o *unstructured.Unstructured) bool { | ||
func (r *SQLInstanceReconcileGate) ShouldReconcile(o *unstructured.Unstructured) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to update the other direct resources to include the optIn ReconcileGate also, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the default now :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Check out RegisterModel)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, cool!
And good question re the update; I think though that those tests probably should be based on the "primary" controller, rather than the "opt-in" / "override" controller... at least that's what I think looking at how IsTFResource etc are used. Open to other views though! |
Right now, the behavior is based on the labels in the CRD. If TF label -> use TF reconciler. If DCL label -> use DCL reconciler. If neither TF or DCL labels -> use Direct reconciler. Does that seem ok? |
b9710f7
to
f14dc5d
Compare
(I switched to an annotation, feels more consistent, and added a test) |
7c71e91
to
3aead8c
Compare
I like the idea of allowing users to opt-in the alpha direct reconciler ( a big relief on migrating the stable resources). My main concern is that we basically surface the TF reconciler in the KCC object level, but to me these are the implementation details to users and they should not care. Also, when we have to recommend users to switch back to the TF-reconciler due to a regression (rather than fully control the reconciler and fixing it in the next release ourselves), we are basically sending the signals that Direct is less stable than TF. Or we can only turn on this feature in very specific resources like sql. BTW, looks like this PR does not have test for |
Add support for a new annotation, 'alpha.cnrm.cloud.google.com/reconciler' If set to `direct`, the direct reconciler will be used.
We just create a parallel version of an existing test.
We can treat this the same as Ptr
3aead8c
to
2db88e0
Compare
So I imagine this annotation will be used to let customers opt-in to early access to the direct controller. That is going to be less tested than a beta controller in widespread use, I think that's OK and understandable. I don't think we would recommend using this to force the terraform controller once we've promoted the direct controller to be the default (I guess we could, though it isn't supported today) I don't understand why SQLInstance, is that because it has the complex predicate? The problem is that it's already in |
That sounds good. basically you mean the
Yes and also because this PR adds the opt-in in sqlinstance and no test covers it (I think?). |
/lgtm Still have some open questions to discuss. But no blockers. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yuwenma The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c55a528
into
GoogleCloudPlatform:master
Add support for a new label, 'alpha.cnrm.cloud.google.com/reconciler'
If set to
direct
, the direct reconciler will be used.