Skip to content

run chaos-daemon in privileged by default#1453

Merged
WangXiangUSTC merged 5 commits into
chaos-mesh:masterfrom
cwen0:set_privilege
Jan 28, 2021
Merged

run chaos-daemon in privileged by default#1453
WangXiangUSTC merged 5 commits into
chaos-mesh:masterfrom
cwen0:set_privilege

Conversation

@cwen0
Copy link
Copy Markdown
Member

@cwen0 cwen0 commented Jan 26, 2021

Signed-off-by: cwen0 cwenyin0@gmail.com

What problem does this PR solve?

What is changed and how does it work?

Add a field to control privileged mode and run chaos-daemon in privileged by default.

Checklist

Tests

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

Side effects

  • Breaking backward compatibility

Related changes

  • Need to update the documentation

Does this PR introduce a user-facing change?

NONE

Signed-off-by: cwen0 <cwenyin0@gmail.com>
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jan 26, 2021

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.00%. Comparing base (7e9ff3f) to head (510e5f6).
⚠️ Report is 1560 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1453      +/-   ##
==========================================
- Coverage   55.78%   52.00%   -3.78%     
==========================================
  Files          68       80      +12     
  Lines        4383     5107     +724     
==========================================
+ Hits         2445     2656     +211     
- Misses       1768     2183     +415     
- Partials      170      268      +98     

see 80 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

{{- end }}
securityContext:
{{- if .Values.chaosDaemon.privileged }}
privileged: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove 2 spaces here.
I think privileged: true should keep the same indent level with capabilities.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

Signed-off-by: cwen0 <cwenyin0@gmail.com>
@cwen0 cwen0 requested a review from STRRL January 27, 2021 05:32
STRRL
STRRL previously approved these changes Jan 27, 2021
Copy link
Copy Markdown
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.

LGTM

{{- if .Values.chaosDaemon.privileged }}
privileged: true
{{- else }}
capabilities:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we need to remove these capabilities when privileged is true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SYS_PTRACE must be kept and others can be removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Other capabilities are unnecessary when privileged is true, except SYS_PTRACE. I think we can delete them to make the code cleaner

Signed-off-by: cwen0 <cwenyin0@gmail.com>
Signed-off-by: cwen0 <cwenyin0@gmail.com>
Copy link
Copy Markdown
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

LGTM

@WangXiangUSTC
Copy link
Copy Markdown
Contributor

/merge

@ti-srebot
Copy link
Copy Markdown
Contributor

Your auto merge job has been accepted, waiting for:

  • 1330

@ti-srebot
Copy link
Copy Markdown
Contributor

/run-all-tests

@WangXiangUSTC WangXiangUSTC merged commit e7db1ee into chaos-mesh:master Jan 28, 2021
@cwen0 cwen0 deleted the set_privilege branch January 28, 2021 03:36
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.

5 participants