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

Support updating chaos experiments by API #570

Merged
merged 4 commits into from
Jun 2, 2020

Conversation

cwen0
Copy link
Member

@cwen0 cwen0 commented May 28, 2020

Signed-off-by: cwen0 [email protected]

What problem does this PR solve?

#520

What is changed and how does it work?

Support updating chaos experiments by API

Check List

Tests

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

Code changes

  • Has Go code change
  • Has CI related scripts change
  • Has Terraform scripts change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to update the documentation

Does this PR introduce a user-facing change?:

NONE

@codecov-commenter
Copy link

codecov-commenter commented May 28, 2020

Codecov Report

Merging #570 into master will decrease coverage by 0.20%.
The diff coverage is 54.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #570      +/-   ##
==========================================
- Coverage   55.98%   55.78%   -0.21%     
==========================================
  Files          67       68       +1     
  Lines        4324     4383      +59     
==========================================
+ Hits         2421     2445      +24     
- Misses       1733     1768      +35     
  Partials      170      170              
Impacted Files Coverage Δ
api/v1alpha1/iochaos_types.go 40.00% <ø> (ø)
controllers/iochaos_controller.go 85.71% <ø> (ø)
pkg/chaosdaemon/time_server.go 88.23% <ø> (ø)
pkg/webhook/config/config.go 17.14% <ø> (ø)
pkg/utils/selector.go 52.24% <40.00%> (-0.24%) ⬇️
pkg/store/experiment/experiment.go 38.77% <45.23%> (ø)
controllers/twophase/types.go 55.88% <74.07%> (+0.09%) ⬆️

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 56631a0...8a9fe63. Read the comment docs.

f, ok := updateFuncs[exp.Target.Kind]
if !ok {
c.Status(http.StatusBadRequest)
_ = c.Error(utils.ErrInvalidRequest.New("Target kind is not available"))
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 changing to "_ = c.Error(utils.ErrInvalidRequest.New(exp.Target.Kind + " is not supported")) "?

}

f, ok := createFuncs[exp.Target.Kind]
if !ok {
c.Status(http.StatusBadRequest)
_ = c.Error(utils.ErrInvalidRequest.New("Target kind is not available"))
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 changing to "_ = c.Error(utils.ErrInvalidRequest.New(exp.Target.Kind + " is not supported")) "?

Signed-off-by: cwen0 <[email protected]>
@cwen0 cwen0 requested review from fewdan, yeya24 and Yisaer May 29, 2020 06:56
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Looks very good.

pkg/apiserver/experiment/experiment.go Show resolved Hide resolved
Signed-off-by: cwen0 <[email protected]>
Copy link
Member

@fewdan fewdan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

LGTM

},
{
"Repository": "github.com/swaggo/swag",
"Commit": "eebe67fc31c39a02a763bcaa815baab805112cf3"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it intended?

@zhouqiang-cl
Copy link
Contributor

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Jun 2, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Jun 2, 2020

@cwen0 merge failed.

@cwen0 cwen0 merged commit 432cb53 into chaos-mesh:master Jun 2, 2020
@cwen0 cwen0 deleted the edit_chaos_experiment branch June 2, 2020 02:31
sjwsl pushed a commit to sjwsl/chaos-mesh that referenced this pull request May 6, 2021
* update chaos experiments by API

Signed-off-by: cwen0 <[email protected]>

* address comments

Signed-off-by: cwen0 <[email protected]>

Co-authored-by: pingcap-github-bot <[email protected]>
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.

6 participants