Skip to content

OCPBUGS-15934: use *resource.Quantity to not automatically set 0#1656

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
QiWang19:resourcequantity
Nov 15, 2023
Merged

OCPBUGS-15934: use *resource.Quantity to not automatically set 0#1656
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
QiWang19:resourcequantity

Conversation

@QiWang19
Copy link
Copy Markdown
Member

close: https://issues.redhat.com/browse/OCPBUGS-15934
- 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.

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

# 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

Signed-off-by: Qi Wang <qiwan@redhat.com>
@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. labels Nov 10, 2023
@openshift-ci-robot
Copy link
Copy Markdown

@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
  • bug is open, matching expected state (open)
  • bug target version (4.15.0) matches configured target version for branch (4.15.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (schoudha@redhat.com), skipping review request.

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

Details

In response to this:

close: https://issues.redhat.com/browse/OCPBUGS-15934
- 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.

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

# 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 kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Nov 10, 2023
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 10, 2023

Hello @QiWang19! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 10, 2023
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 10, 2023

@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.

@JoelSpeed
Copy link
Copy Markdown
Contributor

Is 0 a valid value? ie can users opt to have no logs by deliberately setting the value to 0 or do you not support this case?

@QiWang19
Copy link
Copy Markdown
Member Author

QiWang19 commented Nov 13, 2023

Is 0 a valid value? ie can users opt to have no logs by deliberately setting the value to 0 or do you not support this case?

@JoelSpeed The 0 is a valid value. The problem though is that logSizeMax is deprecated in ContainerRuntimeConfig. We have Red Hat Insights rules for OpenShift Container Platform that recommending to move these problematic parameters from ContainerRuntimeConfig to KubeletConfig. Having them still set in ContainerRuntimeConfig will trigger a false/positive alert in Red Hat Insights as generally the customer may have followed the recommendation but the system does not comply with the changes made. So it could generate undesired amount of requests from customers because they are following a recommendation that in turn is causing an effect as seen in this Bug.

Copy link
Copy Markdown
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2023
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed, QiWang19

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 15, 2023
@openshift-merge-bot openshift-merge-bot Bot merged commit 27d4f9b into openshift:master Nov 15, 2023
@openshift-ci-robot
Copy link
Copy Markdown

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

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

Details

In response to this:

close: https://issues.redhat.com/browse/OCPBUGS-15934
- 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.

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

# 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 kubernetes/test-infra repository.

@openshift-bot
Copy link
Copy Markdown

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-cluster-config-api-container-v4.15.0-202311151551.p0.g27d4f9b.assembly.stream for distgit ose-cluster-config-api.
All builds following this will include this PR.

@openshift-merge-robot
Copy link
Copy Markdown
Contributor

Fix included in accepted release 4.15.0-0.nightly-2023-11-15-172405

@openshift-merge-robot
Copy link
Copy Markdown
Contributor

Fix included in accepted release 4.15.0-0.nightly-2023-12-02-123536

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. 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants