-
Notifications
You must be signed in to change notification settings - Fork 875
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: remove the setTransitionTime from cluster status controller. #3316
Fix: remove the setTransitionTime from cluster status controller. #3316
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3316 +/- ##
==========================================
- Coverage 49.13% 49.12% -0.01%
==========================================
Files 209 209
Lines 18754 18751 -3
==========================================
- Hits 9214 9212 -2
+ Misses 9039 9038 -1
Partials 501 501
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you delete setTransitionTime
together? Seems this function is non-used.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you have a test on it to see if the condition transition time is set as expected?
It should be ok, but one more test would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks~
/lgtm
@XiShanYongYe-Chang @RainbowMango need to approve:) |
Have you made a test on your local site? |
I'll add some unit test cases a little later. |
@RainbowMango @XiShanYongYe-Chang unit tests have been added, take a look. |
Hi, @xigang thanks for your work. I think we don't need to add ut to the method in the third-party library, but judging from your new ut context, what @RainbowMango says is satisfied. Can you help remove the newly added ut, and we can continue to approve? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't make it clear.
Can you have a test on it to see if the condition transition time is set as expected?
I mean we can test it manually would be fine. No worries, I can help do it.
But, please remove the unit test.
…roller Signed-off-by: xigang <wangxigang2014@gmail.com>
@XiShanYongYe-Chang @RainbowMango The newly added unit tests have been removed. I only have the local environment, can you help verify it in your test environment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works. Thanks.
/lgtm
/approve
Ready condition:
- lastTransitionTime: "2023-03-23T02:01:33Z"
message: cluster is healthy and ready to accept workloads
reason: ClusterReady
status: "True"
type: Ready
Not Ready condition:
- lastTransitionTime: "2023-03-23T02:06:53Z" ## We can see the transitionTime is updated as expected.
message: cluster is not reachable
reason: ClusterNotReachable
status: "False"
type: Ready
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
@RainbowMango Thanks for help verify. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
There is no need to call setTransitionTime before calling the SetStatusCondition method. From the code logic, call setTransitionTime is not required.
https://github.com/karmada-io/karmada/blob/master/pkg/controllers/status/cluster_status_controller.go#L180 and https://github.com/karmada-io/karmada/blob/master/pkg/controllers/status/cluster_status_controller.go#L205
Which issue(s) this PR fixes:
Fixes ##3313
Special notes for your reviewer:
@XiShanYongYe-Chang
Does this PR introduce a user-facing change?: