Skip to content
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

Bump k8s dependecies to v1.25 #761

Closed
wants to merge 11 commits into from

Conversation

yaron-idan
Copy link

This PR bumps k8s dependencies to v1.25 to address CVE-2020-8558 and close issue #742

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 1, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @yaron-idan!

It looks like this is your first PR to kubernetes/node-problem-detector 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/node-problem-detector has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 1, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @yaron-idan. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yaron-idan
Once this PR has been reviewed and has the lgtm label, please assign vteratipally for approval. For more information see the Kubernetes Code Review Process.

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

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

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 1, 2023
Copy link
Contributor

@MartinForReal MartinForReal left a comment

Choose a reason for hiding this comment

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

Please remove files under .idea

MartinForReal

This comment was marked as spam.

MartinForReal

This comment was marked as resolved.

@yaron-idan
Copy link
Author

Hey @MartinForReal, I've removed the .idea folder from the PR.

@@ -107,7 +108,7 @@ func (c *nodeProblemClient) SetConditions(newConditions []v1.NodeCondition) erro
if err != nil {
return err
}
return c.client.RESTClient().Patch(types.StrategicMergePatchType).Resource("nodes").Name(c.nodeName).SubResource("status").Body(patch).Do().Error()
return c.client.RESTClient().Patch(types.StrategicMergePatchType).Resource("nodes").Name(c.nodeName).SubResource("status").Body(patch).Do(context.TODO()).Error()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'd better to introduce context package into NPD, context.TODO() should not be used with product code.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, but let's make that a separate change. I think it's fine to use TODO for now.

Copy link
Author

Choose a reason for hiding this comment

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

I've worked on a commit adding context last night, here it is for reference.

@@ -38,30 +38,30 @@ func (mc *memoryCollector) collect() {
}

if mc.mBytesUsed != nil {
memUsed := meminfo.MemTotal - meminfo.MemFree - meminfo.Buffers - meminfo.Cached - meminfo.Slab
mc.mBytesUsed.Record(map[string]string{stateLabel: "free"}, int64(meminfo.MemFree)*1024)
memUsed := *meminfo.MemTotal - *meminfo.MemFree - *meminfo.Buffers - *meminfo.Cached - *meminfo.Slab
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think if we need to make sure pointer is not nil.

Copy link
Author

Choose a reason for hiding this comment

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

It's a good idea, I've added a check to the condition.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean maybe we should check if meminfo.MemFree, meminfo.Buffers or other item is nil

Copy link
Author

Choose a reason for hiding this comment

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

Gotcha, I updated the condition. Does this fit what you meant?

golang.org/x/sys v0.8.0
google.golang.org/api v0.118.0
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
Copy link
Contributor

@MartinForReal MartinForReal Jun 1, 2023

Choose a reason for hiding this comment

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

Please check the status of go mod graph. Although k8s.io related dependencies are set to 1.25.10 in replace rules, the actual required version is 1.27. we need to find the library which requires k8s.io 1.27 and downgrade them if any.

Copy link
Author

Choose a reason for hiding this comment

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

I haven't found any mention of v1.27 when running go mod graph, are you sure it's been required somewhere in the project?

@@ -24,8 +25,8 @@ import (
"sync"
"time"

"k8s.io/klog"
inotify "k8s.io/utils/inotify"
"github.com/fsnotify/fsnotify"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering why this library is replaced with "github.com/fsnotify/fsnotify"

@@ -38,30 +38,30 @@ func (mc *memoryCollector) collect() {
}

if mc.mBytesUsed != nil {
memUsed := meminfo.MemTotal - meminfo.MemFree - meminfo.Buffers - meminfo.Cached - meminfo.Slab
mc.mBytesUsed.Record(map[string]string{stateLabel: "free"}, int64(meminfo.MemFree)*1024)
memUsed := *meminfo.MemTotal - *meminfo.MemFree - *meminfo.Buffers - *meminfo.Cached - *meminfo.Slab
Copy link
Contributor

Choose a reason for hiding this comment

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

I mean maybe we should check if meminfo.MemFree, meminfo.Buffers or other item is nil

@vteratipally
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 2, 2023
@yaron-idan
Copy link
Author

/retest

@k8s-ci-robot
Copy link
Contributor

@yaron-idan: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-npd-test e31f5a3 link true /test pull-npd-test
pull-npd-e2e-test e31f5a3 link true /test pull-npd-e2e-test
pull-npd-build e31f5a3 link true /test pull-npd-build
pull-npd-e2e-node e31f5a3 link true /test pull-npd-e2e-node

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 26, 2023
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@MartinForReal
Copy link
Contributor

#793 is merged.

@hakman
Copy link
Member

hakman commented Sep 19, 2023

NPD dependencies were bumped to 1.28.2. Most CVEs should be addressed in the next release.

@MartinForReal
Copy link
Contributor

/close

@k8s-ci-robot
Copy link
Contributor

@MartinForReal: Closed this PR.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants