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

Improve env init on deploying and scale-out cluster #678

Merged
merged 8 commits into from
Aug 17, 2020

Conversation

lucklove
Copy link
Member

What problem does this PR solve?

At this time, we will create the user which is specified in topology.yml on deploy and scale-out stage.
However, the topology.yml only allows specifying the user name excepting the user group name. Sometimes the user may want to create the user, but using an existed group name.

BTW: fix #677

What is changed and how it works?

Add a group field in the topology file

Check List

Tests

  • Integration testing

Release notes:

Support specifying user group or skipping creating a user in the deploy and scale-out stage
- to specify the group: https://github.com/pingcap/tiup/blob/master/examples/topology.example.yaml#L7
- to skip creating the user: `tiup cluster deploy/scale-out --skip-create-user xxx`

Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

Please add some tests.

Signed-off-by: lucklove <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2020

Codecov Report

Merging #678 into master will increase coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #678      +/-   ##
==========================================
+ Coverage   57.55%   57.61%   +0.05%     
==========================================
  Files         250      250              
  Lines       17932    17941       +9     
==========================================
+ Hits        10321    10336      +15     
+ Misses       6256     6250       -6     
  Partials     1355     1355              
Flag Coverage Δ
#coverage 57.61% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...c/github.com/pingcap/tiup/pkg/cluster/api/dmapi.go 61.31% <0.00%> (-1.46%) ⬇️
...src/github.com/pingcap/tiup/pkg/cluster/manager.go 69.05% <0.00%> (ø)
...c/github.com/pingcap/tiup/pkg/cluster/spec/spec.go 90.94% <0.00%> (ø)
...m/pingcap/tiup/components/cluster/command/audit.go 84.61% <0.00%> (ø)
...ithub.com/pingcap/tiup/pkg/cluster/task/builder.go 94.09% <0.00%> (+0.04%) ⬆️
.../pingcap/tiup/components/cluster/command/deploy.go 74.46% <0.00%> (+0.55%) ⬆️
...ngcap/tiup/components/cluster/command/scale_out.go 68.08% <0.00%> (+0.69%) ⬆️
...thub.com/pingcap/tiup/pkg/cluster/task/env_init.go 57.14% <0.00%> (+1.82%) ⬆️
...github.com/pingcap/tiup/pkg/cluster/module/user.go 60.00% <0.00%> (+3.24%) ⬆️
...src/github.com/pingcap/tiup/pkg/cliutil/cliutil.go 72.05% <0.00%> (+5.88%) ⬆️
... and 1 more

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 d156c6a...4e9fd59. Read the comment docs.

Signed-off-by: lucklove <[email protected]>
@lonng lonng added the status/need-doc Indicates that we should update document before merge a PR. label Aug 14, 2020
pkg/cluster/module/user.go Outdated Show resolved Hide resolved
Copy link
Contributor

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

Signed-off-by: lucklove <[email protected]>
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 14, 2020
@lonng
Copy link
Contributor

lonng commented Aug 14, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 14, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@lucklove merge failed.

@lonng lonng merged commit 72bd731 into pingcap:master Aug 17, 2020
@lonng lonng deleted the group branch August 17, 2020 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1. status/need-doc Indicates that we should update document before merge a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cluster user deploy cluster feature,skip create user
4 participants