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

Backport of Add dr-token Flag to Autopilot CLI into release/1.12.x #22683

Merged

Conversation

hc-github-team-secure-vault-core
Copy link
Collaborator

Backport

This PR is auto-generated from #21165 to be assessed for backporting due to the inclusion of the label backport/1.12.x.

The below text is copied from the body of the original PR.


For other operator commands such as list-peers we support a -dr-token flag:

vault operator raft list-peers -dr-token="<DR_OP_TOKEN>"

For autopilot commands, though, you have to pass it in via VAULT_TOKEN:

VAULT_TOKEN="<DR_OP_TOKEN>" vault operator raft autopilot state
VAULT_TOKEN="<DR_OP_TOKEN>" vault operator raft autopilot get-config
VAULT_TOKEN="<DR_OP_TOKEN>" vault operator raft autopilot set-config

These changes will allow the token to be passed via flag, as well as maintaining the VAULT_TOKEN env variable method

VAULT_TOKEN=$dr_token vault operator raft autopilot state
vault operator raft autopilot state -dr-token=$dr_token

VAULT_TOKEN=$dr_token vault operator raft autopilot get-config
vault operator raft autopilot get-config -dr-token=$dr_token

VAULT_TOKEN=$dr_token vault operator raft autopilot set-config \
    -dead-server-last-contact-threshold=10 \
    -server-stabilization-time=30 \
    -cleanup-dead-servers=true \
    -min-quorum=3
VAULT_TOKEN=$dr_token vault operator raft autopilot get-config    
vault operator raft autopilot set-config \
    -dead-server-last-contact-threshold=15 \
    -server-stabilization-time=45 \
    -cleanup-dead-servers=false \
    -min-quorum=3 \
    -dr-token=$dr_token 
vault operator raft autopilot get-config -dr-token=$dr_token

Overview of commits

@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/drtokenflag/repeatedly-optimal-reptile branch from 483e9eb to 12835dd Compare August 31, 2023 12:58
@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/drtokenflag/repeatedly-optimal-reptile branch from f51827f to 74c5e40 Compare August 31, 2023 12:58
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Aug 31, 2023
@github-actions
Copy link

Build Results:
All builds succeeded! ✅

@ltcarbonell ltcarbonell added this to the 1.12.11 milestone Aug 31, 2023
@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

@ltcarbonell ltcarbonell enabled auto-merge (squash) August 31, 2023 13:18
@ltcarbonell ltcarbonell merged commit 7571d9f into release/1.12.x Aug 31, 2023
85 checks passed
@ltcarbonell ltcarbonell deleted the backport/drtokenflag/repeatedly-optimal-reptile branch August 31, 2023 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants