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

[add] add uid in events and archive_experiments #623

Merged
merged 4 commits into from
Jun 15, 2020
Merged

[add] add uid in events and archive_experiments #623

merged 4 commits into from
Jun 15, 2020

Conversation

fewdan
Copy link
Member

@fewdan fewdan commented Jun 12, 2020

What problem does this PR solve?

add uid in events and archive_experiments

What is changed and how does it work?

add uid in events and archive_experiments

Check List

Tests

  • No code

Code changes

  • Has Go code change

Side effects

  • NO

Related changes

  • NO

Does this PR introduce a user-facing change?

NONE

@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2020

Codecov Report

Merging #623 into master will decrease coverage by 0.17%.
The diff coverage is 21.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #623      +/-   ##
==========================================
- Coverage   55.78%   55.61%   -0.18%     
==========================================
  Files          68       68              
  Lines        4383     4393      +10     
==========================================
- Hits         2445     2443       -2     
- Misses       1768     1779      +11     
- Partials      170      171       +1     
Impacted Files Coverage Δ
controllers/networkchaos/ipset/ipset.go 37.14% <0.00%> (ø)
pkg/store/experiment/experiment.go 32.20% <0.00%> (-6.58%) ⬇️
pkg/utils/chaosdaemon.go 51.21% <0.00%> (ø)
pkg/utils/grpc.go 0.00% <0.00%> (ø)
controllers/networkchaos/netem/types.go 47.27% <50.00%> (ø)
controllers/podchaos/containerkill/types.go 64.38% <100.00%> (ø)
controllers/timechaos/types.go 61.44% <100.00%> (ø)
pkg/utils/selector.go 51.42% <0.00%> (-0.82%) ⬇️

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 d7aaceb...87c59f7. Read the comment docs.

@fewdan fewdan requested review from cwen0, yeya24 and Yisaer and removed request for cwen0 June 12, 2020 11:25
@yeya24
Copy link
Contributor

yeya24 commented Jun 12, 2020

Can I ask what this UID for? Do you want to connect the chaos object in Kubernetes with the event in DB? Could you please introduce some use cases?

@fewdan
Copy link
Member Author

fewdan commented Jun 12, 2020

Can I ask what this UID for? Do you want to connect the chaos object in Kubernetes with the event in DB? Could you please introduce some use cases?

@yeya24
There is a problem that if chaos with the same name is deleted and then created, it cannot be distinguished in db.
So if uid is introduced, you can distinguish chaos with the same name (because their uid is different). In this case, only need to modify the API, without modifying other parts of chaos-mesh, can meet the requirements.

@yeya24
Copy link
Contributor

yeya24 commented Jun 12, 2020

Can I ask what this UID for? Do you want to connect the chaos object in Kubernetes with the event in DB? Could you please introduce some use cases?

@yeya24
There is a problem that if chaos with the same name is deleted and then created, it cannot be distinguished in db.
So if uid is introduced, you can distinguish chaos with the same name (because their uid is different). In this case, only need to modify the API, without modifying other parts of chaos-mesh, can meet the requirements.

Got it. I can understand that this field is used to differentiate different chaos but with the same name.

But from #608 (comment), if we plan to add unique suffix to chaos name, then is it still necessary to have the UID?

@fewdan
Copy link
Member Author

fewdan commented Jun 13, 2020

@yeya24
We have discussed, and the conclusion is that there are some shortcomings in adding a suffix, so we decided to use UID+name+NS+kind to distinguish different chaos.
The disadvantages of adding a suffix are:

  1. The name is changed, it is inconvenient for the user to edit or delete chaos.
  2. The user cannot operate by "kubectl delete -f xxx.yaml".

If you use UID, you only need to modify the chaos-dashboard part to meet the user's requirements, and it is more reasonable.
So after this PR merge, I will modify other APIs.

Copy link
Member

@cwen0 cwen0 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

pkg/core/event.go Outdated Show resolved Hide resolved
Copy link
Member

@cwen0 cwen0 left a comment

Choose a reason for hiding this comment

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

LGTM

@fewdan fewdan requested a review from Gallardot June 15, 2020 11:19
@fewdan
Copy link
Member Author

fewdan commented Jun 15, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit a26f169 into chaos-mesh:master Jun 15, 2020
@fewdan fewdan deleted the uid branch June 16, 2020 07:26
shonge pushed a commit to shonge/chaos-mesh that referenced this pull request Jul 7, 2020
sjwsl pushed a commit to sjwsl/chaos-mesh that referenced this pull request May 6, 2021
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