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
✨ testdata/cronjob_types.go: add NestedStructWithSeveralFieldsDoubleMarked #704
✨ testdata/cronjob_types.go: add NestedStructWithSeveralFieldsDoubleMarked #704
Conversation
…everalFields The type `NestedStructWithSeveralFields` is already annotated. Annotating the field of the same name is not necessary, might confuse user looking at this example and potentially cover up future regressions (the field annotation might cover up the type annotation not having the wanted effect). Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
Welcome @jan--f! |
Hi @jan--f. 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. |
This is a tiny (but I think worthwhile) fix, following up on #692. Hence ping @chrischdi and @FillZpp |
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.
/lgtm
I'm not sure, should we keep this test to verify that annotated on both field and type, to avoid bugs like these #688 and #693 (comment) |
Yes that makes sense, I added a commit to that effect. WDYT? |
ping @FillZpp Any further concerns about this? |
@jan--f I don't understand what's the difference between |
This adds a field to the cronjob test data, that ensures that fields which are marked twice (once through a type marker, one through a field marker) still generate the correct yaml structure. Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
04d17a3
to
b25a1f6
Compare
/ok-to-test |
/lgtm |
@chrischdi anything still blocking this? |
/lgtm from my side. But requires a maintainer for approval (which I am not). |
Thanks, let me try @pwittrock and @mengqiy for an |
// A struct that can only be entirely replaced via a nested type and | ||
// field markers. | ||
// +structType=atomic | ||
NestedStructWithSeveralFieldsDoubleMarked NestedStructWithSeveralFields `json:"nestedStructWithSeveralFieldsDoubleMarked"` |
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 seems a workarround. Could you please raise an issue or add in the description:
a) what you were doing when you face the error ( with an example code )
b) what do you expected to see ?
c) what was the behaviour faced instead?
Also, if we move forward here I think we need a better name than FieldsDoubleMarked
. DoubleMarket with what? (i.e. NestedStructWithSeveralFieldsMarkedWithAB)
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.
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.
@camilamacedo86 so this just adds an additional test case. NestedStructWithSeveralFields
ensures that the resulting manifest carries the atomic
marker from the type. NestedStructWithSeveralFieldsDoubleMarked
ensures the same thing only that the marker is applied to the type, as well as the to the field of the struct.
@@ -162,9 +162,13 @@ type CronJobSpec struct { | |||
StructWithSeveralFields NestedObject `json:"structWithSeveralFields"` | |||
|
|||
// A struct that can only be entirely replaced via a nested type. | |||
// +structType=atomic |
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.
Why it was 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.
It was added the the new declaration below.
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 seems requires more info first.
/label tide/merge-method-squash |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, jan--f 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 |
Thanks! |
This adds a field to the cronjob test data, that ensures that fields
which are marked twice (once through a type marker, one through a field
marker) still generate the correct yaml structure.
Signed-off-by: Jan Fajerski jfajersk@redhat.com