-
Notifications
You must be signed in to change notification settings - Fork 218
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
docs: Update workflow for resource migration with reconciler annotation #2860
base: master
Are you sure you want to change the base?
docs: Update workflow for resource migration with reconciler annotation #2860
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
small comments but overall looks great, thanks for making these changes 🙏🏼
Copy all existing test cases and add `-direct` suffix to the test names. | ||
|
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.
Let's offer an example maybe of what the final folder will look like here?
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.
Good call, added an example
|
||
This will override the `cnrm.cloud.google.com/dcl2crd: "true"` or `cnrm.cloud.google.com/tf2crd: "true"` annotations in the CRD and enable the direct controller for the new test cases. The previously-existing test cases will continue to use the TF/DCL-based controller. | ||
|
||
Verify the new `-direct` test cases have equivalent behavior to the existing test cases (though not necessarily the exact same API interactions, if the direct controller achieves the same end result differently than the TF/DCL-based controller). |
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.
As an external contributor, how do I verify this 🙃 ? Would it be sufficient for now that the new tests pass?
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.
Personally, I feel like it's impossible to expect external contributers to develop new controllers with only mock tests. They will need to verify behavior with real gcp, using hack/record-gcp
.
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.
How about suggesting users to use git mv
when creating the -direct
test cases. So that the PR git-diff shows whether it gives equivalent behavior or not.
* The roundtrip fuzz tests shall cover all the fields in `spec `and `status.observedState `fields [example](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/0bbac86ace6ab2f4051b574f026d5fe47fa05b75/pkg/controller/direct/redis/cluster/roundtrip_test.go#L92) |
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.
* The roundtrip fuzz tests shall cover all the fields in `spec `and `status.observedState `fields [example](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/0bbac86ace6ab2f4051b574f026d5fe47fa05b75/pkg/controller/direct/redis/cluster/roundtrip_test.go#L92) | |
* The roundtrip fuzz tests covers all the fields in `spec `and `status.observedState `fields [example](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/0bbac86ace6ab2f4051b574f026d5fe47fa05b75/pkg/controller/direct/redis/cluster/roundtrip_test.go#L92) |
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.
This seems totally unrelated, no? Created #2866.
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.
What is this change about? I apply RFC2119 on the wordings for should
and shall
here.
This is the first step in removing KCC_USE_DIRECT_RECONCILERS, and switching over to using the user-configurable annotation instead. This lets us simultaneously test/review the behavior of legacy TF/DCL-based controllers and the new direct controllers.
9a860fd
to
4c5d00b
Compare
### For DCL-based Beta resource | ||
|
||
* Remove the `cnrm.cloud.google.com/dcl2crd: "true"` label from the CRD will turn on SciFi controller. | ||
* Remove all of the duplicate `-direct` mockgcp test cases, and re-record mockgcp interactions (now using direct controller instead of legacy TF/DCL). |
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.
I think we want to make it clear that the transient -direct
test cases are only required for Beta TF/DCL migration
|
||
### For TF-based Beta resource | ||
* Remove the `cnrm.cloud.google.com/dcl2crd: "true"` or `cnrm.cloud.google.com/tf2crd: "true"` go tag from the CRD struct, and run `dev/tasks/generate-crds` to use Direct as the permanent controller. |
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.
I like the wording changes, can we also keep the example? Otherwise it could be hard for contributors to figure out what the CRD struct
or API
refers to.
@@ -1,14 +1,10 @@ | |||
# 5. Release | |||
|
|||
## 5.1 Turn on your Direct controller (TF/DCL Beta Only) | |||
## 5.1 Make Direct controller the default (for migration from TF/DCL) |
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.
You may want to keep the Beta only
because Alpha TF/DCL migration does not require changing the tf2crd or dcl2crd labels.
### PR Reviews | ||
|
||
* We require the roundtrip fuzz tests to cover all the fields in `spec` and `status.observedState` fields [example](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/0bbac86ace6ab2f4051b574f026d5fe47fa05b75/pkg/controller/direct/redis/cluster/roundtrip_test.go#L92) (For mapper) | ||
* We require removing the `cnrm.cloud.google.com/dcl2crd: "true"` or `cnrm.cloud.google.com/tf2crd: "true"` tags from the API and the presubmit test passes. | ||
* We require duplicating all existing test cases (by copying and adding `-direct` suffix to test names), and enabling the direct controller in the new test cases (by setting the `alpha.cnrm.cloud.google.com/reconciler: direct` annotation). |
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.
Suggest giving more detailed guidance so we can verify this, like "using git mv
to ..."
|
||
This will override the `cnrm.cloud.google.com/dcl2crd: "true"` or `cnrm.cloud.google.com/tf2crd: "true"` annotations in the CRD and enable the direct controller for the new test cases. The previously-existing test cases will continue to use the TF/DCL-based controller. | ||
|
||
Verify the new `-direct` test cases have equivalent behavior to the existing test cases (though not necessarily the exact same API interactions, if the direct controller achieves the same end result differently than the TF/DCL-based controller). |
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.
How about suggesting users to use git mv
when creating the -direct
test cases. So that the PR git-diff shows whether it gives equivalent behavior or not.
This is the first step in removing KCC_USE_DIRECT_RECONCILERS, and switching over to using the user-configurable annotation instead.
This lets us simultaneously test/review the behavior of legacy TF/DCL-based controllers and the new direct controllers.