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

[ISSUE #52] Remove noise error log message #54

Merged
merged 3 commits into from
Aug 25, 2018

Conversation

huanwei
Copy link
Contributor

@huanwei huanwei commented Aug 24, 2018

Signed-off-by: huanwei <huan@harmonycloud.cn>
@CLAassistant
Copy link

CLAassistant commented Aug 24, 2018

CLA assistant check
All committers have signed the CLA.

@huanwei
Copy link
Contributor Author

huanwei commented Aug 24, 2018

PTAL. @weekface

@gregwebs
Copy link
Contributor

The zero value comparison in this case should be the empty string rather than nil.

pkg/util/util.go Outdated
glog.Errorf("failed to parse CPU resource %s to quantity: %v", spec.Requests.CPU, err)
} else {
rr.Requests[corev1.ResourceCPU] = q
if spec.Requests.CPU != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

spec.Requests.CPU's type is string, can't compared with nil, replace nil with "" instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got.

pkg/util/util.go Outdated
glog.Errorf("failed to parse memory resource %s to quantity: %v", spec.Requests.Memory, err)
} else {
rr.Requests[corev1.ResourceMemory] = q
if spec.Requests.Memory != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

pkg/util/util.go Outdated
glog.Errorf("failed to parse CPU resource %s to quantity: %v", spec.Limits.CPU, err)
} else {
rr.Limits[corev1.ResourceCPU] = q
if spec.Limits.CPU != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

pkg/util/util.go Outdated
glog.Errorf("failed to parse memory resource %s to quantity: %v", spec.Limits.Memory, err)
} else {
rr.Limits[corev1.ResourceMemory] = q
if spec.Limits.Memory != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Signed-off-by: huanwei <huan@harmonycloud.cn>
@huanwei
Copy link
Contributor Author

huanwei commented Aug 24, 2018

@weekface @gregwebs Thanks for your review.

@tennix
Copy link
Member

tennix commented Aug 24, 2018

@huanwei Thanks for your contribution!
The noisy error log message comes from resource.ParseQuantity, by grepping ParseQuantity you'll find 3 other places calling ParseQuantity:

q, err := resource.ParseQuantity(limits.Storage)

q, err = resource.ParseQuantity(size)

q, err = resource.ParseQuantity(size)

The latter two are parsing storage requests for PVC, it must be non-empty because most platform needs this value to allocate a PV, so the error message is OK here. But the first one, tikv storage capacity is not required to be non-empty, if it's empty we set it to zero, but we got noisy error messages. So you need to fix this too.

@weekface
Copy link
Contributor

@tennix
This PR only fix the CPU and Memory noisy error messages problem. It is enough for this PR. The storage problem should be fixed in another PR i think.

@weekface
Copy link
Contributor

/run-e2e-tests

Copy link
Contributor

@weekface weekface left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

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

LGTM

@tennix
Copy link
Member

tennix commented Aug 25, 2018

OK, we'll merge this PR now. @huanwei can you send another PR to fix the issue I listed above?

@tennix tennix merged commit 5e1c431 into pingcap:master Aug 25, 2018
@huanwei
Copy link
Contributor Author

huanwei commented Aug 26, 2018

@tennix Sure. I will submit a new PR to handle the storage problem.

@huanwei huanwei deleted the remove-noise-error branch August 26, 2018 16:39
queenliuxx pushed a commit to queenliuxx/tidb-operator that referenced this pull request Dec 19, 2018
* remove noise error

Signed-off-by: huanwei <huan@harmonycloud.cn>
yahonda pushed a commit that referenced this pull request Dec 27, 2021
* Update backup-to-s3.md

* en: add IAM ENV for S3 backup and restore

* update from #57

* Apply suggestions from code review

Co-Authored-By: Lilian Lee <lilin@pingcap.com>

Co-authored-by: Lilian Lee <lilin@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants