openstack-k8s-operators dependency bump branch: main#1613
Conversation
|
Hi @github-actions[bot]. Thanks for your PR. I'm waiting for a openstack-k8s-operators 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. DetailsInstructions 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-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: github-actions[bot], stuggi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
Prow is still broken and has been for hours at this point. |
|
/retest |
1 similar comment
|
/retest |
98b488b to
f2f61ac
Compare
|
New changes are detected. LGTM label has been removed. |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/98f9f1f231584363a42e6df8b6f80560 ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 17m 24s |
2416819 to
2b5d277
Compare
2b5d277 to
cd74c5e
Compare
|
Looks like removing @gibizer can you help check this? When using operator-lint 0.3.0, it cribbed about https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openstack-k8s-operators_openstack-baremetal-operator/326/pull-ci-openstack-k8s-operators-openstack-baremetal-operator-main-precommit-check/1971089793609633792 and I removed omitempty from those fields to comply. However, it causes issues when the type is used in openstack-operator https://github.com/openstack-k8s-operators/openstack-operator/blob/main/apis/dataplane/v1beta1/openstackdataplanenodeset_types.go#L40 and a CR leaves out baremetalSetTemplate field. |
|
This is what we've in BMO https://github.com/metal3-io/baremetal-operator/blob/main/apis/metal3.io/v1alpha1/baremetalhost_types.go#L481-L483 which has all the three (default, optional, omitempty) |
I've reverted back to what was there before with openstack-k8s-operators/openstack-baremetal-operator#326 |
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/034a61fc75d248288c10800f14df1787 ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 23m 24s |
The error message says that indeed the field is defined as a string with an enum validation with two possible value. So it cannot be set to "". If I have to guess what is missing is a proper initialization / defaulting of the usage of OpenStackBaremetalSetTemplateSpec that embeds the field. If a field with type OpenStackBaremetalSetTemplateSpec is not initialized then go will initialize it with the type's null value, which for a (non pointer) struct will be a recursive initialization of the struct's field each with the null value. A string field's null value in golang in the "". So from go perspective it needs to be set to "" but from validation perspective that is not a valid value. I suggest to look into how we define / default / initialize the field that has type OpenStackBaremetalSetTemplateSpec. In general golang / k8s JSON SER/DES is hard. Also I'm OK to ignore the lint and keep the omitempty as I have not time to dig deeper into the issue and offer a full solution. |
Thanks! It's defaulted[1] in the OpenStackBaremetalSetTemplateSpec struct itself like what's in BMO[2]. [1] https://github.com/openstack-k8s-operators/openstack-baremetal-operator/blob/main/api/v1beta1/openstackbaremetalset_types.go#L77 |
I meant looking at a struct with a field with a type of OpenStackBaremetalSetTemplateSpec. We saw before that defaulting fields that has a type that is a struct is tricky. E.g. I remember I had to do these type of defaulting on the high level field def to avoid similar problems in the past https://github.com/openstack-k8s-operators/nova-operator/blob/a6113c8dcb738f50941c4d81f96afb199890207a/api/v1beta1/nova_types.go#L53-L58 |
cd74c5e to
593facd
Compare
Yeah I tried to use |
|
dataplane functional tests pass for me locally, let me re-run that. |
|
/test functional |
593facd to
3617016
Compare
| containers: | ||
| - name: operator | ||
| env: | ||
| - name: RELATED_IMAGE_BARBICAN_OPERATOR_MANAGER_IMAGE_URL |
There was a problem hiding this comment.
something is wrong that those get removed
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/0360402840e8489f8f2b6cfe0187a033 ❌ openstack-k8s-operators-content-provider FAILURE in 15m 51s |
Hm if that struct has mandatory fields, then the usage of this struct here cannot be optional. I think that is the conflict causing this issue. I.e. There is no way to say that the field is optional if some of its sub fields are mandatory. My immediate reaction is to make BaremetalSetTemplate a pointer not a value. That way it can be optional with a value of nil. But I did not have the full view of what that change can cause elsewhere so I'm not suggesting to do that blindly. |
3617016 to
85048bc
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/969382d8d7fb40ddb04120e63b7fc3b0 ✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 27m 04s |
|
recheck |
|
/test openstack-operator-build-deploy-kuttl-4-18 |
Thanks. It's weird, but that's how go works it seems i.e. "initialize all fields with 0 and empty string unless it's a pointer". I think we can convert it to a pointer. |
|
/test openstack-operator-build-deploy-kuttl |
|
/test openstack-operator-build-deploy-kuttl |
|
/retest |
|
/test openstack-operator-build-deploy-kuttl-4-18 |
|
/retest |
1 similar comment
|
/retest |
Automated changes by create-pull-request GitHub action
Jira: OSPRH-12935