-
Notifications
You must be signed in to change notification settings - Fork 312
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
Use alternative privilege escalation command to initialize the environment #799
base: master
Are you sure you want to change the base?
Use alternative privilege escalation command to initialize the environment #799
Conversation
Codecov Report
@@ Coverage Diff @@
## master #799 +/- ##
===========================================
- Coverage 48.41% 18.81% -29.60%
===========================================
Files 262 233 -29
Lines 18834 17054 -1780
===========================================
- Hits 9118 3209 -5909
- Misses 8270 13373 +5103
+ Partials 1446 472 -974
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
We have many more locations that uses |
Thank you Allen for reviewing this. I had a quick chat with Long Heng yesterday and he suggested the same thing. There is another issue here that actually we don't need |
Yes the only thing we need from the initial root account is to create the service account ( |
2b53da1
to
12791b3
Compare
Hi, is it possible to make the option global (like |
Sure, but I'm quite busy recently. Will take a look at this later. |
@darkelf21cn: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Codecov Report
@@ Coverage Diff @@
## master #799 +/- ##
===========================================
- Coverage 55.41% 29.87% -25.54%
===========================================
Files 279 265 -14
Lines 19709 18379 -1330
===========================================
- Hits 10921 5491 -5430
- Misses 7070 12039 +4969
+ Partials 1718 849 -869
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #799 +/- ##
===========================================
- Coverage 55.41% 29.88% -25.53%
===========================================
Files 279 265 -14
Lines 19709 18379 -1330
===========================================
- Hits 10921 5491 -5430
- Misses 7070 12039 +4969
+ Partials 1718 849 -869
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Kimi Wang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
What problem does this PR solve?
The
su
command is used in theEnvInit
structure to initialize the tidb service account. However, the command is not always allowed in all the environments. For example, in our Linux environment,sudo
is allowed butsu
andrunuser
are prohibited. So it's better to determine what is supported first then use the supported one to initialize the environment.What is changed and how it works?
The
PrivilegeEscalationMethod
is added to theEnvInit
structure which defines all the available privilege escalation methods. When init_env starts, it will first try all the methods until a supported method is found. Then it will use that method to finish the initialization. An error will be raised if there is no privilege escalation method available.Check List
Tests
I'm happy to write unit tests but I didn't write one because the command need to interact with operation system. So I just wrote some code to print the command and run it manually on my test lab. Please advice if you have better suggestions.
Code changes
Side effects
Related changes
None
Release notes: