-
Notifications
You must be signed in to change notification settings - Fork 57
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
add field-level element relationship which overrides referred type #220
add field-level element relationship which overrides referred type #220
Conversation
/cc @Jefftree |
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 tests for that, thanks
Added tests, addressed comments. |
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 I'd like to see a more sophisticated test to show that this works correctly, take an example of a test in merge/
where you can specify the schema and the operations, make sure they work properly.
schema/elements.go
Outdated
} | ||
|
||
default: | ||
// Atom violates invariant that one of Map/List/Scalar is set |
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 empty Atom return value is just terrible. I don't think we handle it properly anywhere and usually leads to hard to debug errors. Anyways, just ranting :-)
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 the contract of this function is to not inspect the first return value of the second is false
.
64b6430
to
90eb201
Compare
tests added, newline removed ;) |
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 guess you probably considered duplicating+renaming types as needed instead of this?
f0a394c
to
60b3b65
Compare
/restest I double checked the diff from that gofmt error. My checkout does not contain those changes. I tried to re-run gofmt locally but saw no changes. Not seeing the same thing on my side... Maybe the CI is confused? It is expecting changes in comments replacing |
/retest Had typo in last attempt. |
typed/typed.go
Outdated
// value. | ||
// - Container typed elements will have their items ordered: | ||
// - like tv, if pso doesn't change anything in the container | ||
// - like pso, if pso does change something in the container. |
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 extra indenting in the original was deliberate...
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.
unfortunately gofmt won't allow this anymore so I was forced to change it to an ordered list.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, lavalamp 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 |
I tagged the merged commit with |
I suspect the schema change to pointer is backwards incompatible, I'll have to fix the tag and change the release branch to v5. |
I removed the v4.2.2 tag since I think it was not correct semver. |
Part of our solution for kubernetes/kubernetes#110495
Adds necessary functionality to support field-level annotations which may override the annotation of the referred type.