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

JVMChaos: support inject fault into MySQL client #3189

Closed
wants to merge 14 commits into from

Conversation

WangXiangUSTC
Copy link
Contributor

@WangXiangUSTC WangXiangUSTC commented Apr 26, 2022

What problem does this PR solve?

close issue #2977

What's changed and how it works?

Related changes

  • Need to update chaos-mesh/website
  • Need to update Dashboard UI
  • Need to cheery-pick to release branches
    • release-2.1
    • release-2.0

Checklist

CHANGELOG

  • I have updated the CHANGELOG.md
  • I have labeled this PR with "no-need-update-changelog"

Tests

  • Unit test
  • E2E test
  • No code
  • Manual test (add steps below)

Side effects

  • Breaking backward compatibility

Release note

Please add a release note.

You can safely ignore this section if you don't think this PR needs a release note.

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@codecov
Copy link

codecov bot commented Apr 26, 2022

Codecov Report

Merging #3189 (2f494a4) into master (0d0ed09) will increase coverage by 0.08%.
The diff coverage is 54.54%.

❗ Current head 2f494a4 differs from pull request most recent head bd09def. Consider uploading reports for the commit bd09def to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3189      +/-   ##
==========================================
+ Coverage   40.84%   40.93%   +0.08%     
==========================================
  Files         164      164              
  Lines       13798    13830      +32     
==========================================
+ Hits         5636     5661      +25     
- Misses       7735     7740       +5     
- Partials      427      429       +2     
Impacted Files Coverage Δ
api/v1alpha1/jvmchaos_types.go 33.33% <ø> (ø)
api/v1alpha1/jvmchaos_webhook.go 60.71% <0.00%> (-8.68%) ⬇️
controllers/chaosimpl/jvmchaos/impl.go 37.65% <69.23%> (+5.53%) ⬆️
pkg/selector/generic/mode.go 25.64% <0.00%> (-2.57%) ⬇️
pkg/workflow/controllers/utils.go 87.59% <0.00%> (+1.55%) ⬆️
controllers/statuscheck/controller.go 84.14% <0.00%> (+4.87%) ⬆️
.../workflow/controllers/abort_workflow_reconciler.go 57.14% <0.00%> (+8.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d80563f...bd09def. Read the comment docs.

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

rest LGTM! ❤️

// SQL is "select * from test.t1",
// only when ((Database == "test" || Database == "") && (Table == "t1" || Table == "") && (SQLType == "select" || SQLType == "")) is true, JVMChaos will inject fault
type JVMMySQLSpec struct {
// the version of mysql-connector-java, only support 5.X.X(set to 5) and 8.X.X(set to 8) now
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// the version of mysql-connector-java, only support 5.X.X(set to 5) and 8.X.X(set to 8) now
// the version of mysql-connector-java, only support 5.X.X(set to "5") and 8.X.X(set to "8") now

using a double quote to emphasize here requires a string

Comment on lines 83 to 85
if len(in. MySQLConnectorVersion) == 0 {
allErrs = append(allErrs, field.Invalid(path, in, "MySQL connector version not provided"))
}
Copy link
Member

Choose a reason for hiding this comment

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

also check the version could only be "5" or "8"?

@@ -79,6 +79,13 @@ func (in *JVMChaosSpec) Validate(root interface{}, path *field.Path) field.Error
if len(in.RuleData) == 0 {
allErrs = append(allErrs, field.Invalid(path, in, "rule data not provide"))
}
case JVMMySQLAction:
if len(in. MySQLConnectorVersion) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if len(in. MySQLConnectorVersion) == 0 {
if len(in.MySQLConnectorVersion) == 0 {

Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
Signed-off-by: xiang <xiang13225080@163.com>
@WangXiangUSTC
Copy link
Contributor Author

There is something wrong with my git tree and it's difficult to resolve, I will open another pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants