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
Check the length of parts while using ParseNamespacedName and ParseNamespacedNameContainer #2141
Conversation
Welcome @FingerLeader! |
Signed-off-by: FingerLeader <FingerLeader@gmail.com>
Signed-off-by: FingerLeader <FingerLeader@gmail.com> add length check of parts
* fix: deadline reconciler, keep deadline exceed with true Signed-off-by: STRRL <str_ruiling@outlook.com> * chore: enriching log things Signed-off-by: STRRL <str_ruiling@outlook.com> * test: testcases about this issue Signed-off-by: STRRL <str_ruiling@outlook.com> * test: finish TODO Signed-off-by: STRRL <str_ruiling@outlook.com> * test: finished TODO Signed-off-by: STRRL <str_ruiling@outlook.com> * chore: refine codes and appending test case Signed-off-by: STRRL <str_ruiling@outlook.com> * chore: make linters happy Signed-off-by: STRRL <str_ruiling@outlook.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Signed-off-by: Yue Yang <g1enyy0ung@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: FingerLeader <wanxfinger@gmail.com>
/run-e2e-tests |
Codecov Report
@@ Coverage Diff @@
## master #2141 +/- ##
===========================================
- Coverage 55.78% 42.96% -12.82%
===========================================
Files 68 128 +60
Lines 4383 8865 +4482
===========================================
+ Hits 2445 3809 +1364
- Misses 1768 4727 +2959
- Partials 170 329 +159
Continue to review full report at Codecov.
|
/run-e2e-tests |
/run-e2e-tests |
1 similar comment
/run-e2e-tests |
…ontainer Signed-off-by: FingerLeader <wanxfinger@gmail.com>
controllers/utils/controller/key.go
Outdated
}, strings.Join(parts[2:], "") | ||
Namespace: "", | ||
Name: "", | ||
}, "", errors.New("Too Few Parts of NamespacedName") |
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.
ST1005: error strings should not be capitalized
(at-me in a reply with help
or ignore
)
Thanks for your suggestion! I'll have a try next time |
podId, containerName, err := controller.ParseNamespacedNameContainer(record.Id) | ||
if err != nil { | ||
// TODO: organize the error in a better way | ||
err = NewFailToFindContainer(pod.Namespace, pod.Name, containerName, err) |
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's still an issue.
/run-e2e-test |
The file mode changes are unexpected behavior, please revert them, @FingerLeader. |
Actually, I don't know why the file modes are changed. After reseting my branch to |
I wonder if it's due to sth like git index cache, you could try the following commands to rollback to the upstream branch state:
For a simple solution about this, I think you could just delete your local repo and re-clone it? |
Signed-off-by: FingerLeader <wanxfinger@gmail.com>
I set |
Signed-off-by: FingerLeader <wanxfinger@gmail.com>
/run-e2e-test |
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.
LGTM!
It's really a long way to get this LGTM. Thanks for your help! |
So @STRRL suggested that the |
But IOChaos uses |
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.
LGTM
Please also record an issue as the TODO (just in case you forget). /merge |
This pull request has been accepted and is ready to merge. Commit hash: 209de76
|
/merge |
cherry pick to release-1.2 failed |
cherry pick to release-2.0 failed |
What problem does this PR solve?
Issue Number: close #1933
Problem Summary:
What is changed and how it works?
Before returning value, check the length of parts to avoid panic.
Checklist
Tests