Skip to content

[release-4.14]OCPBUGS-27178: use *resource.Quantity to not automatically set 0#4121

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.14from
QiWang19:backport-resource-quantity-4-14
Jan 23, 2024
Merged

[release-4.14]OCPBUGS-27178: use *resource.Quantity to not automatically set 0#4121
openshift-merge-bot[bot] merged 1 commit into
openshift:release-4.14from
QiWang19:backport-resource-quantity-4-14

Conversation

@QiWang19
Copy link
Copy Markdown
Member

@QiWang19 QiWang19 commented Jan 15, 2024

Backport API fix openshift/api#1656
- What I did
Change the type of OverlaySize and LogSizeMax resource.Quantity to pointer *resource.Quantity.
the struct type will be set as 0 automatically when retrieving the ctrcfg object.
- How to verify it

# apply the containerruntimeconfig CR
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
 name: pidlimit
spec:
 machineConfigPoolSelector:
   matchLabels:
     pools.operator.machineconfiguration.openshift.io/worker: '' 
 containerRuntimeConfig:
   pidsLimit: 4096 
   logLevel: debug

# current result:
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
  "logLevel": "debug",
  "logSizeMax": "0",
  "overlaySize": "0",
  "pidsLimit": 4096
}

# after this patch, it will be 
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
  "logLevel": "debug",
  "pidsLimit": 4096
}

- Description for the changelog

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 15, 2024
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jan 15, 2024
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 15, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@QiWang19: This pull request references Jira Issue OCPBUGS-27178, which is valid. The bug has been moved to the POST state.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.z) matches configured target version for branch (4.14.z)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-15934 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-15934 targets the "4.15.0" version, which is one of the valid target versions: 4.15.0
  • bug has dependents

Requesting review from QA contact:
/cc @lyman9966

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

- What I did
Change the type of OverlaySize and LogSizeMax resource.Quantity to pointer *resource.Quantity.
the struct type will be set as 0 automatically when retrieving the ctrcfg object.
- How to verify it

# apply the containerruntimeconfig CR
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
name: pidlimit
spec:
machineConfigPoolSelector:
  matchLabels:
    pools.operator.machineconfiguration.openshift.io/worker: '' 
containerRuntimeConfig:
  pidsLimit: 4096 
  logLevel: debug

# current result:
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
 "logLevel": "debug",
 "logSizeMax": "0",
 "overlaySize": "0",
 "pidsLimit": 4096
}

# after this patch, it will be 
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
 "logLevel": "debug",
 "pidsLimit": 4096
}

- Description for the changelog

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested a review from lyman9966 January 15, 2024 20:00
Signed-off-by: Qi Wang <qiwan@redhat.com>
@QiWang19 QiWang19 force-pushed the backport-resource-quantity-4-14 branch from 7d3fa43 to d26c41f Compare January 15, 2024 20:16
@QiWang19 QiWang19 marked this pull request as ready for review January 15, 2024 20:55
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 15, 2024
@openshift-ci openshift-ci Bot requested review from mtrmac and yuqi-zhang January 15, 2024 20:56
@QiWang19
Copy link
Copy Markdown
Member Author

/cherry-pick release-4.13

@openshift-cherrypick-robot
Copy link
Copy Markdown

@QiWang19: once the present PR merges, I will cherry-pick it on top of release-4.13 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-4.13

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
Copy link
Copy Markdown
Member Author

/retest

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@QiWang19: This pull request references Jira Issue OCPBUGS-27178, which is valid.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.14.z) matches configured target version for branch (4.14.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-15934 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-15934 targets the "4.15.0" version, which is one of the valid target versions: 4.15.0
  • bug has dependents

Requesting review from QA contact:
/cc @lyman9966

Details

In response to this:

Backport API fix openshift/api#1656
- What I did
Change the type of OverlaySize and LogSizeMax resource.Quantity to pointer *resource.Quantity.
the struct type will be set as 0 automatically when retrieving the ctrcfg object.
- How to verify it

# apply the containerruntimeconfig CR
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
name: pidlimit
spec:
machineConfigPoolSelector:
  matchLabels:
    pools.operator.machineconfiguration.openshift.io/worker: '' 
containerRuntimeConfig:
  pidsLimit: 4096 
  logLevel: debug

# current result:
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
 "logLevel": "debug",
 "logSizeMax": "0",
 "overlaySize": "0",
 "pidsLimit": 4096
}

# after this patch, it will be 
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
 "logLevel": "debug",
 "pidsLimit": 4096
}

- Description for the changelog

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 openshift-eng/jira-lifecycle-plugin repository.

@QiWang19
Copy link
Copy Markdown
Member Author

@yuqi-zhang @lyman9966 PTAL

Copy link
Copy Markdown
Contributor

@yuqi-zhang yuqi-zhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is kind of a weird case where we're changing the API in different places based on the version.

I'm fine with this offhand since it should be a safe change anyways. It doesn't map as well from a backport perspective to a singular PR but so long as it's not breaking anything I think we should be good?

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 16, 2024
@lyman9966
Copy link
Copy Markdown

/label qe-approved

test passed:
$ oc get containerruntimeconfig parameter-testing -o json | jq '.spec.containerRuntimeConfig'
{
"logLevel": "debug",
"pidsLimit": 2049
}

@rphillips
Copy link
Copy Markdown
Contributor

/lgtm

@rphillips
Copy link
Copy Markdown
Contributor

/label backport-risk-assessed

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. labels Jan 19, 2024
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: QiWang19, rphillips, yuqi-zhang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sunilcio
Copy link
Copy Markdown

/label cherry-pick-approved

@openshift-ci openshift-ci Bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Jan 23, 2024
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD acc2d27 and 2 for PR HEAD d26c41f in total

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jan 23, 2024

@QiWang19: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit a4b8a7c into openshift:release-4.14 Jan 23, 2024
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@QiWang19: Jira Issue OCPBUGS-27178: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-27178 has been moved to the MODIFIED state.

Details

In response to this:

Backport API fix openshift/api#1656
- What I did
Change the type of OverlaySize and LogSizeMax resource.Quantity to pointer *resource.Quantity.
the struct type will be set as 0 automatically when retrieving the ctrcfg object.
- How to verify it

# apply the containerruntimeconfig CR
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
name: pidlimit
spec:
machineConfigPoolSelector:
  matchLabels:
    pools.operator.machineconfiguration.openshift.io/worker: '' 
containerRuntimeConfig:
  pidsLimit: 4096 
  logLevel: debug

# current result:
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
 "logLevel": "debug",
 "logSizeMax": "0",
 "overlaySize": "0",
 "pidsLimit": 4096
}

# after this patch, it will be 
$ oc get containerruntimeconfig  pidlimit -o json | jq '.spec.containerRuntimeConfig'
{
 "logLevel": "debug",
 "pidsLimit": 4096
}

- Description for the changelog

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-cherrypick-robot
Copy link
Copy Markdown

@QiWang19: #4121 failed to apply on top of branch "release-4.13":

Applying: use *resource.Quantity to not automatically set 0
Using index info to reconstruct a base tree...
M	pkg/apis/machineconfiguration.openshift.io/v1/types.go
M	pkg/apis/machineconfiguration.openshift.io/v1/zz_generated.deepcopy.go
M	pkg/controller/container-runtime-config/container_runtime_config_bootstrap.go
M	pkg/controller/container-runtime-config/container_runtime_config_controller.go
M	pkg/controller/container-runtime-config/container_runtime_config_controller_test.go
M	pkg/controller/container-runtime-config/helpers.go
M	pkg/controller/container-runtime-config/helpers_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/container-runtime-config/helpers_test.go
Auto-merging pkg/controller/container-runtime-config/helpers.go
Auto-merging pkg/controller/container-runtime-config/container_runtime_config_controller_test.go
CONFLICT (content): Merge conflict in pkg/controller/container-runtime-config/container_runtime_config_controller_test.go
Auto-merging pkg/controller/container-runtime-config/container_runtime_config_controller.go
Auto-merging pkg/controller/container-runtime-config/container_runtime_config_bootstrap.go
Auto-merging pkg/apis/machineconfiguration.openshift.io/v1/zz_generated.deepcopy.go
Auto-merging pkg/apis/machineconfiguration.openshift.io/v1/types.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 use *resource.Quantity to not automatically set 0
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Details

In response to this:

/cherry-pick release-4.13

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.

@openshift-bot
Copy link
Copy Markdown
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build openshift-proxy-pull-test-container-v4.14.0-202401231409.p0.ga4b8a7c.assembly.stream for distgit openshift-proxy-pull-test.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.