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(controller): fix bug if cnr or cnc is not found in lister #168

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

caohe
Copy link
Member

@caohe caohe commented Jul 25, 2023

What type of PR is this?

Bug fixes

What this PR does / why we need it:

Fix bug if cnr or cnc is not found in lister.

Which issue(s) this PR fixes:

Special notes for your reviewer:

@caohe caohe added the bug Something isn't working label Jul 25, 2023
@caohe caohe added this to the v0.3 milestone Jul 25, 2023
@caohe caohe added the workflow/need-review review: test succeeded, need to review label Jul 25, 2023
@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.08% ⚠️

Comparison is base (1253f13) 50.94% compared to head (4aadc46) 50.87%.

❗ Current head 4aadc46 differs from pull request most recent head a32e408. Consider uploading reports for the commit a32e408 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
- Coverage   50.94%   50.87%   -0.08%     
==========================================
  Files         409      409              
  Lines       38930    38946      +16     
==========================================
- Hits        19834    19814      -20     
- Misses      16877    16926      +49     
+ Partials     2219     2206      -13     
Flag Coverage Δ
unittest 50.87% <0.00%> (-0.08%) ⬇️

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

Files Changed Coverage Δ
pkg/controller/lifecycle/cnc.go 56.27% <0.00%> (-2.18%) ⬇️
pkg/controller/lifecycle/cnr.go 56.27% <0.00%> (-2.18%) ⬇️

... and 18 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caohe caohe added the workflow/merge-ready merge-ready: code is ready and can be merged label Jul 25, 2023
luomingmeng
luomingmeng previously approved these changes Jul 25, 2023
@caohe caohe force-pushed the fix-controller-label-selector branch from 09e55d5 to 4aadc46 Compare July 25, 2023 13:51
@caohe caohe closed this Jul 25, 2023
@caohe caohe force-pushed the fix-controller-label-selector branch from 4aadc46 to 1253f13 Compare July 25, 2023 14:08
Signed-off-by: caohe <caohe9603@gmail.com>
@caohe caohe reopened this Jul 25, 2023
@@ -308,6 +311,12 @@ func (cl *CNRLifecycle) updateOrCreateCNR(node *corev1.Node) error {
if err != nil && !errors.IsAlreadyExists(err) {
return fmt.Errorf("failed to create cnr %s: %v", cnr.Name, err)
}
if errors.IsAlreadyExists(err) {
cnr, err = cl.client.InternalClient.NodeV1alpha1().CustomNodeResources().Get(cl.ctx, node.Name, metav1.GetOptions{ResourceVersion: "0"})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should it also fix updateOrCreateCNC of cnc lifecycle like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, cnc will be fixed in a later pr.

@waynepeking348 waynepeking348 merged commit 6443329 into kubewharf:main Jul 26, 2023
@caohe caohe deleted the fix-controller-label-selector branch July 26, 2023 02:23
luomingmeng pushed a commit to luomingmeng/katalyst-core that referenced this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workflow/merge-ready merge-ready: code is ready and can be merged workflow/need-review review: test succeeded, need to review
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

3 participants