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

fix panic when printing log when lastSuccessfulTime of cronjob is nil #3683

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

chaunceyjiang
Copy link
Member

@chaunceyjiang chaunceyjiang commented Jun 20, 2023

What type of PR is this?
/kind bug

What this PR does / why we need it:

fix aggregateCronJobStatus panic

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

When job is not successful even once, lastSuccessfulTime will always benil. Printing logs at this time will cause a panic.

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Fixed panic when printing log in case lastSuccessfulTime of cronjob is nil.

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 20, 2023
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 20, 2023
@chaunceyjiang
Copy link
Member Author

/cc @XiShanYongYe-Chang

@codecov-commenter
Copy link

Codecov Report

Merging #3683 (c3a4c26) into master (e95c605) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #3683      +/-   ##
==========================================
- Coverage   56.63%   56.61%   -0.02%     
==========================================
  Files         221      221              
  Lines       20831    20831              
==========================================
- Hits        11797    11793       -4     
- Misses       8411     8414       +3     
- Partials      623      624       +1     
Flag Coverage Δ
unittests 56.61% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ourceinterpreter/default/native/aggregatestatus.go 70.80% <100.00%> (-0.69%) ⬇️

... and 1 file with indirect coverage changes

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Oh, thanks~
How do you find it?
/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 20, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 20, 2023
@karmada-bot karmada-bot merged commit 1791270 into karmada-io:master Jun 20, 2023
8 checks passed
@XiShanYongYe-Chang
Copy link
Member

Can you help cherry-pick it to the affected release branch?

@chaunceyjiang
Copy link
Member Author

How do you find it?

Through the logging system.

@chaunceyjiang chaunceyjiang deleted the cronjob branch June 26, 2023 07:29
karmada-bot added a commit that referenced this pull request Jun 26, 2023
…pstream-release-1.6

Automated cherry pick of #3683: fix aggregateCronJobStatus panic
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. kind/bug Categorizes issue or PR as related to a bug. 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.

4 participants