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

feat: support specify password when deploy #417

Merged
merged 5 commits into from
Nov 25, 2022

Conversation

Xvv-v
Copy link
Contributor

@Xvv-v Xvv-v commented Nov 22, 2022

Sign-off-by: xu.jingwen xu.jingwen@99cloud.net

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #419

Special notes for reviewers:

Does this PR introduced a user-facing change?


Additional documentation, usage docs, etc.:


@kubeclipper-bot
Copy link
Collaborator

@Xvv-v: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

@kubeclipper-bot kubeclipper-bot added kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: no do-not-merge/release-note-label-needed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 22, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2022

Codecov Report

Merging #417 (cbc980b) into release-1.3 (febc920) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-1.3     #417      +/-   ##
===============================================
- Coverage        12.85%   12.85%   -0.01%     
===============================================
  Files              103      103              
  Lines            15842    15843       +1     
===============================================
  Hits              2036     2036              
- Misses           13561    13562       +1     
  Partials           245      245              
Impacted Files Coverage Δ
pkg/cli/deploy/deploy.go 5.66% <0.00%> (-0.01%) ⬇️

@kubeclipper-bot kubeclipper-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 23, 2022
@Xvv-v Xvv-v changed the base branch from master to release-1.3 November 23, 2022 09:25
@kubeclipper-bot kubeclipper-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 23, 2022
Signed-off-by: xu.jingwen <xu.jingwen@99cloud.net>
@kubeclipper-bot kubeclipper-bot added dco-signoff: yes size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed dco-signoff: no needs-rebase size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 24, 2022
Signed-off-by: xu.jingwen <xu.jingwen@99cloud.net>
Signed-off-by: xu.jingwen <xu.jingwen@99cloud.net>
@x893675
Copy link
Collaborator

x893675 commented Nov 24, 2022

/cc @lixd

@@ -85,4 +108,5 @@ func (a *AuthenticationOptions) AddFlags(fs *pflag.FlagSet) {
fs.IntVar(&a.LoginHistoryMaximumEntries, "login-history-maximum-entries", a.LoginHistoryMaximumEntries, "login-history-maximum-entries defines how many entries of login history should be kept.")
fs.DurationVar(&a.OAuthOptions.AccessTokenMaxAge, "access-token-max-age", a.OAuthOptions.AccessTokenMaxAge, "access-token-max-age control the lifetime of access tokens, 0 means no expiration.")
fs.DurationVar(&a.MaximumClockSkew, "maximum-clock-skew", a.MaximumClockSkew, "The maximum time difference between the system clocks of the ks-apiserver that issued a JWT and the ks-apiserver that verified the JWT.")
fs.StringVar(&a.InitialPassword, "user-password", constatns.DefaultAdminUserPass, "internal user password")
Copy link
Contributor

@lixd lixd Nov 24, 2022

Choose a reason for hiding this comment

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

maybe need to specify this flag is specify for admin user.

and why not use a.InitialPassword as default value like kcctl deploy?

@@ -362,6 +362,7 @@ func (s *APIServer) migrateUser(operator iam.Operator) error {
return nil
}

Users := GetInternalUser(s.Config.AuthenticationOptions.InitialPassword)
Copy link
Contributor

Choose a reason for hiding this comment

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

rename Users to users

@@ -164,6 +163,7 @@ func NewCmdDeploy(streams options.IOStreams) *cobra.Command {
cmd.Flags().DurationVar(&o.deployConfig.AuthenticationOpts.AuthenticateRateLimiterDuration, "authenticate-rate-limiter-duration", o.deployConfig.AuthenticationOpts.AuthenticateRateLimiterDuration, "specifies the lock duration of the user")
cmd.Flags().DurationVar(&o.deployConfig.AuthenticationOpts.LoginHistoryRetentionPeriod, "login-history-retention-period", o.deployConfig.AuthenticationOpts.LoginHistoryRetentionPeriod, "login-history-retention-period defines how long login history should be kept.")
cmd.Flags().IntVar(&o.deployConfig.AuthenticationOpts.LoginHistoryMaximumEntries, "login-history-maximum-entries", o.deployConfig.AuthenticationOpts.LoginHistoryMaximumEntries, "login-history-maximum-entries defines how many entries of login history should be kept.")
cmd.Flags().StringVar(&o.deployConfig.AuthenticationOpts.InitialPassword, "user-password", o.deployConfig.AuthenticationOpts.InitialPassword, "internal user password")
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe need to specify this flag is specify for admin user

Signed-off-by: xu.jingwen <xu.jingwen@99cloud.net>
Signed-off-by: xu.jingwen <xu.jingwen@99cloud.net>
@lixd
Copy link
Contributor

lixd commented Nov 24, 2022

/lgtm

@kubeclipper-bot kubeclipper-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2022
@kubeclipper-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 3d7e43cc144c2530cb98c7e0668711a5050f94bb

@x893675
Copy link
Collaborator

x893675 commented Nov 25, 2022

/approve

@kubeclipper-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: x893675, Xvv-v

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeclipper-bot kubeclipper-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2022
@x893675
Copy link
Collaborator

x893675 commented Nov 25, 2022

/cherrypick master

@kubeclipper-bot
Copy link
Collaborator

@x893675: once the present PR merges, I will cherry-pick it on top of master in a new PR and assign it to you.

In response to this:

/cherrypick master

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.

@kubeclipper-bot kubeclipper-bot merged commit 1b9df4f into kubeclipper:release-1.3 Nov 25, 2022
@kubeclipper-bot
Copy link
Collaborator

@x893675: new pull request created: #426

In response to this:

/cherrypick master

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.

@Xvv-v Xvv-v deleted the deploy branch November 29, 2022 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes do-not-merge/release-note-label-needed kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support specify admin password when deploy
5 participants