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

re-push "add volume kubelet_volume_stats_health_abnormal to kubelet #105585" #108758

Merged
merged 3 commits into from Mar 30, 2022

Conversation

fengzixu
Copy link
Contributor

@fengzixu fengzixu commented Mar 17, 2022

What type of PR is this?

/kind feature
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes kubernetes/enhancements#2900

Special notes for your reviewer:

Does this PR introduce a user-facing change?

add one metrics(`kubelet_volume_stats_health_abnormal`) of volume health state to kubelet

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

https://github.com/kubernetes/enhancements/pull/2900

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 17, 2022
@fengzixu
Copy link
Contributor Author

/sig storage

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 17, 2022
@fengzixu
Copy link
Contributor Author

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Mar 17, 2022
@fengzixu
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 17, 2022
@fengzixu
Copy link
Contributor Author

/assign @xing-yang

@fengzixu
Copy link
Contributor Author

oh. I see. the previous PR is reverted. I shouldn't rebase the current master branch

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/test sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 17, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 22, 2022
@xing-yang
Copy link
Contributor

/assign @dashpole

@dashpole
Copy link
Contributor

/approve

@@ -263,6 +267,13 @@ func expectedFSStats() kubestats.FsStats {
}
}

func expectedVolumeHealthStats() *kubestats.VolumeHealthStats {
metric := expectedMetrics()
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't you have the nil check here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Event if you worry about the metric is nil in normal logic, we may need to check nil in here
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/server/stats/volume_stat_calculator.go#L136

But I checked implementations of GetMetrics function, when metric return value is nil, the error is not nil.
Before we used metric, we already checked error is not nil.

So, I think there is no issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Even if it is a test, I think we should still check nil to be safe.

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Archive-it in SIG Node CI/Test Board Mar 23, 2022
@ehashman
Copy link
Member

/triage accepted
/priority important-soon

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 24, 2022
@ehashman ehashman moved this from Triage to Needs Approver in SIG Node PR Triage Mar 24, 2022
@@ -263,6 +267,13 @@ func expectedFSStats() kubestats.FsStats {
}
}

func expectedVolumeHealthStats() *kubestats.VolumeHealthStats {
metric := expectedMetrics()
Copy link
Contributor

Choose a reason for hiding this comment

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

Even if it is a test, I think we should still check nil to be safe.

metric := expectedMetrics()
return &kubestats.VolumeHealthStats{
Abnormal: *metric.Abnormal,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should check both metric and metric.Abnormal are not nil.

Also check if Abnormal or Message is nil before dereferencing them:
https://github.com/kubernetes/kubernetes/blob/v1.24.0-alpha.4/pkg/kubelet/server/stats/volume_stat_calculator_test.go#L243-L244

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2022
@xing-yang
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2022
@xing-yang
Copy link
Contributor

/assign @mrunalp

@xing-yang
Copy link
Contributor

/assign @dims

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dashpole, fengzixu, mrunalp

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 29, 2022
@k8s-ci-robot k8s-ci-robot merged commit b0254c8 into kubernetes:master Mar 30, 2022
SIG Node PR Triage automation moved this from Needs Approver to Done Mar 30, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 30, 2022
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. area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Development

Successfully merging this pull request may close these issues.

None yet

9 participants