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: fix dynamicRESTMapper nil pointer bug #1088

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

LaurenceLiZhixin
Copy link
Member

Fix bug of RESTMapperManager.dynamicRESTMapper nil pointer.
When _internal/restmapper/cache-crd-restmapper.conf exist but is empty, the current implement would cause npe.

@openyurt-bot openyurt-bot added the size/S size/S 10-29 label Dec 5, 2022
@openyurt-bot
Copy link
Collaborator

Welcome @LaurenceLiZhixin! It looks like this is your first PR to openyurtio/openyurt 🎉

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LaurenceLiZhixin, rambohe-ch

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

@openyurt-bot openyurt-bot added the approved approved label Dec 5, 2022
@rambohe-ch
Copy link
Member

@LaurenceLiZhixin Thank you for posting pull request, please fix the failed unit tests.

}

if len(b) != 0 {
} else {
Copy link
Member

Choose a reason for hiding this comment

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

How about just modify the line 80 as

dm := make(map[schema.GroupVersionResource]schema.GroupVersionKind)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahaaa, u r right....

@openyurt-bot openyurt-bot added size/XS size/XS: 0-9 and removed size/S size/S 10-29 labels Dec 7, 2022
@LaurenceLiZhixin
Copy link
Member Author

I fixed it as you said. @Congrool

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #1088 (920dc92) into master (50f655f) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1088      +/-   ##
==========================================
+ Coverage   53.03%   53.07%   +0.03%     
==========================================
  Files          93       94       +1     
  Lines       12440    12653     +213     
==========================================
+ Hits         6598     6716     +118     
- Misses       5274     5367      +93     
- Partials      568      570       +2     
Flag Coverage Δ
unittests 53.07% <100.00%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
pkg/yurthub/kubernetes/meta/restmapper.go 74.07% <100.00%> (ø)
pkg/yurtadm/cmd/join/join.go 55.39% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Congrool
Copy link
Member

Congrool commented Dec 7, 2022

@LaurenceLiZhixin Thanks!
/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Dec 7, 2022
@openyurt-bot openyurt-bot merged commit cf02f61 into openyurtio:master Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved lgtm lgtm size/XS size/XS: 0-9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants