-
Notifications
You must be signed in to change notification settings - Fork 71
Unsupport atomic to granular schema reconciliation #192
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
Unsupport atomic to granular schema reconciliation #192
Conversation
|
Hi @kevindelgado. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
I went ahead and removed the atomic-to-granular testing that we had. Let me know if you think there's any testing we need to add with this reversion. It seemed odd to have tests to explicitly prove we don't support this flow, but let me know if you think anything like that should be added to this change. FWIW testing to confirm no new fields are added to a top level apply manager will be captured in the testing for the Extract changes (where that behavior is needed), but don't seem super relevant here or in any of the schema reconciliation tests. |
2045cd8 to
f73880c
Compare
| } | ||
| } | ||
|
|
||
| func TestAtomicToGranularSchemaChanges(t *testing.T) { |
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.
Can we actually keep the test and update it with the new behavior? If we document what happens when someone goes from atomic to granular, then we should have a test to confirm that behavior.
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.
Seems useful to me as well. Might also be worth adding a comment in the tests explaining the behavior further.
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.
done, let me know if the comments are sufficient
typed/reconcile_schema.go
Outdated
| func (v *reconcileWithSchemaWalker) doList(t *schema.List) (errs ValidationErrors) { | ||
| // reconcile lists changed from granular to atomic | ||
| // reconcile lists changed from granular to atomic. | ||
| // Note that migrations from atomic to granular are unsuported and will |
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'd change from "unsported" to "unrecommended", and I'm not sure I understand the consequences from that sentence. (comment also applies to below for maps)
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.
done
f73880c to
326ec8e
Compare
| // Upon changing the schema of struct from | ||
| // atomic to granular, manager one continues | ||
| // to own the same fielset as before, | ||
| // but does not retain ownership of any of the subfields. |
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.
Also make it clear that this is a known limitation and not the ideal behavior?
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.
added
326ec8e to
460a665
Compare
|
/lgtm |
460a665 to
4278010
Compare
|
lgtm removed b/c I fixed a comment typo |
|
/lgtm |
| // be treated as if they were always granular. | ||
| // | ||
| // In this case, the manager that owned the previously atomic field (and all subfields), | ||
| // will now own just the top-level field and none of the subfields. |
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.
Perfect
|
/approve Do we have other plans for SMD or should I cut a release once this is merged? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse, kevindelgado 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 |
Fixes #191 by removing support for atomic to granular schema changes.
Now, when a field on a schema is changed from atomic to granular, the schema will be treated as if it was always granular, potentially causing existing managers to own less fields than they did previously. Previously, they would own all the contents of an atomic list/map field, now they will only own the top level field itself and none of its contents.
This was determined to be less worse than incorrectly assuming empty fields were previously atomic (and causing managers to own more fields than they should).
Following this we plan to: