-
Notifications
You must be signed in to change notification settings - Fork 427
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
🐛 Make topology markers also valid for type definitions #692
🐛 Make topology markers also valid for type definitions #692
Conversation
@chrischdi Thanks. Please add some test cases in integration test, and you may also have to test the case that the markers defined on both type and field, like this: type BarSpec struct {
// +listType=map
// +listMapKey=id
Foos Foos `json:"foos,omitempty"`
}
// +listType=map
// +listMapKey=id
type Foos []Foo |
2ec1219
to
9e2b90e
Compare
Hi @FillZpp , thank you for the feedback 👍 I added a test case similar to // +listType=map
// +listMapKey=id
type Foos []Foo However it is not possible to add: type BarSpec struct {
// +listType=map
// +listMapKey=name
// +listMapKey=secondary
Foos Foos `json:"foos,omitempty"`
} Because this will fail at the following marker checks:
The information if it is an array or not is not available there (it is empty string in this case), which is why this PR introduces the possibility to set the markers at the type definition instead. |
9e2b90e
to
3ea6625
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, chrischdi 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 |
/cherrypick release-0.9 |
@alvaroaleman: once the present PR merges, I will cherry-pick it on top of release-0.9 in a new PR and assign it to you. In response to this:
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. |
@alvaroaleman: new pull request created: #693 In response to this:
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. |
This PR allows setting
listMapKey
,listType
,mapType
andstructType
at both type and field level to allow setting them at typed slices too.Currently the markers are only valid at the field level.
The markers are important for defining CRDs which should get used in combination with Server-Side Apply (xref SSA).
Fixes: #435
Example
When a struct references a typed slice it is currently not possible to set the markers.
Example:
type
is empty /""
After this PR, setting the markers will be possible at type level too, where the type information will be available: