OCPBUGS-15934: use *resource.Quantity to not automatically set 0 #3815
OCPBUGS-15934: use *resource.Quantity to not automatically set 0 #3815QiWang19 wants to merge 2 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
8e0f93a to
763d4d6
Compare
|
/test all |
|
/test e2e-aws-ovn |
|
@QiWang19: This pull request references Jira Issue OCPBUGS-15934, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn 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. |
close: https://issues.redhat.com/browse/OCPBUGS-15934 Signed-off-by: Qi Wang <qiwan@redhat.com>
|
@QiWang19: This pull request references Jira Issue OCPBUGS-15934, which is invalid:
Comment DetailsIn 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. |
|
/test all |
|
@QiWang19: This pull request references Jira Issue OCPBUGS-15934, which is invalid:
Comment DetailsIn 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. |
|
@QiWang19: This pull request references Jira Issue OCPBUGS-15934, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (schoudha@redhat.com), skipping review request. DetailsIn 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. |
|
@QiWang19: This pull request references Jira Issue OCPBUGS-15934, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (schoudha@redhat.com), skipping review request. DetailsIn 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. |
|
@mtrmac could you take a look? |
mtrmac
left a comment
There was a problem hiding this comment.
I’m afraid I’m quite unfamiliar with this code.
Looking at the history, #2494 supposedly fixed the same bug just by adding the omitempty annotations. Is it known what has changed that this is no longer sufficient? (I can’t, from a quick check, notice anything in the history of resource.Quantity changing the semantics.)
Or did that never work?
| var configFileList []generatedConfigFile | ||
| ctrcfg := cfg.Spec.ContainerRuntimeConfig | ||
| if !ctrcfg.OverlaySize.IsZero() { | ||
| if ctrcfg.OverlaySize != nil { |
There was a problem hiding this comment.
Applies to all changes:
Doesn’t this change the semantics of previously-created CRs? If I understand the situation correctly, it’s possible that users create the CRs with these fields missing, and something (patchContainerRuntimeConfigs??) updates them and adds "0" field values.
In the old version, those 0 values were treated as missing, i.e. the system did exactly what the users wanted, just in a confusing way; with this PR, wouldn’t the 0 values actually start being applied?
I suppose one way to tell would be to add (uint? e2e?) tests with CRs of that kind, and ensure that both empty values and "0" values are treated as missing. (Or maybe those tests already exist? I didn’t find them though a quick grep but I didn’t spend much time looking.)
There was a problem hiding this comment.
0 values will not be applied in this PR. The drop-in files will not be created if 0 values. https://github.com/openshift/machine-config-operator/pull/3815/files#diff-b2ef9db0d76c6145ec1bb5310134037bae64572ab47464d3223745c2a410d3e3R301
There was a problem hiding this comment.
Oops, my mistake, I didn’t notice that logic.
OverlaySize will, AFAICS, still cause mergeConfigChanges to be called, though with no edits. I guess that doesn’t make a difference.
Aesthetically I’d prefer for the code to consistently use a single condition, so that we just have “set to a relevant value / not set to a relevant value”, not “unset / set to zero / set to non-zero” to track.
But that’s weak a code style preference, to be decided by MCO maintainers.
| if err != nil { | ||
| t.Errorf("%s: failed with %v. should have succeeded", test.name, err) | ||
| } | ||
| require.NotContains(t, string(data), "\"overlaySize\"", "\"overlaySize\"") |
There was a problem hiding this comment.
Testing LogSizeMax might be worthwhile here.
Signed-off-by: Qi Wang <qiwan@redhat.com>
|
Updated: ignore this comment. I was testing on a build based on this PR. 4.14.0-ec.4 4.14.0-0.ci.: |
|
That’s basically the thing that worries me — if we don’t understand how the bug arose, are we certain that we fixed it? E.g. what if the |
Forget about my last comment. I was testing on a cluster that build from this patch. |
|
The patchContainerRuntimeConfigs can add the |
|
OK, so #2494 was not actually sufficient. Thanks! /lgtm |
|
/retest-required |
|
@QiWang19: all tests passed! Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
|
@yuqi-zhang could you approve? |
yuqi-zhang
left a comment
There was a problem hiding this comment.
logically seems sound. cc @jkyros in case this affects the api move at all. Also doing a
/hold
in case we want to pre-merge verify, but feel free to unhold if we feel that is not necessary
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mtrmac, QiWang19, yuqi-zhang 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 |
|
/jira refresh The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity. |
|
@openshift-bot: This pull request references Jira Issue OCPBUGS-15934, which is invalid:
Comment DetailsIn 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. |
|
/jira refresh |
|
@yuqi-zhang: This pull request references Jira Issue OCPBUGS-15934, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (schoudha@redhat.com), skipping review request. DetailsIn 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. |
|
Sorry for the delay, with openshift/api#1453 and #3747, this will first require a change to openshift/api and then re-brought in. |
|
@QiWang19: This pull request references Jira Issue OCPBUGS-15934. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state. DetailsIn 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. |
close: https://issues.redhat.com/browse/OCPBUGS-15934
- What I did
Change the type of
OverlaySizeandLogSizeMaxresource.Quantity to pointer *resource.Quantity.the struct type will be set as 0 automatically when retrieving the ctrcfg object.
I am uncertain if we can make this update to current ContainerruntimeConfig API, I propose this change because the ContainerruntimeConfig API is currently MCO internal.
- How to verify it
- Description for the changelog