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.14.x #22684

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.14.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/perfectly-topical-goblin branch from 7875651 to 05665af Compare August 31, 2023 12:58
@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/drtokenflag/perfectly-topical-goblin branch from 69d3714 to 6b15d5f 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.14.3 milestone Aug 31, 2023
@ltcarbonell ltcarbonell enabled auto-merge (squash) August 31, 2023 13:18
@ltcarbonell ltcarbonell merged commit 6a22f6d into release/1.14.x Aug 31, 2023
85 of 86 checks passed
@ltcarbonell ltcarbonell deleted the backport/drtokenflag/perfectly-topical-goblin branch August 31, 2023 13:18
@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

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.

2 participants