Skip to content

Commit 0156ac6

Browse files
UbuntuCopilot
andcommitted
fix(ch2-auth-tokens/step4): put -increment flag before positional args in token renew
Vault CLI requires flags before positional arguments. Fixed 3 occurrences. Co-authored-by: Copilot <[email protected]>
1 parent b6d46ac commit 0156ac6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • vault-tutorial/ch2-auth-tokens/step4

vault-tutorial/ch2-auth-tokens/step4/text.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ vault token lookup "$TOKEN_NORMAL" | grep -E "ttl|explicit_max_ttl|period"
2727
试图续命 1 小时:
2828

2929
```bash
30-
vault token renew "$TOKEN_NORMAL" -increment=3600
30+
vault token renew -increment=3600 "$TOKEN_NORMAL"
3131
```
3232

3333
返回的 `lease_duration` 不会真的是 3600,会被挂载点 / 系统 max_ttl 顶住
@@ -87,8 +87,8 @@ vault token lookup "$CAPPED" | grep -E "ttl|period|explicit_max_ttl|expire_time"
8787
试图续命:
8888

8989
```bash
90-
sleep 20 && vault token renew "$CAPPED" -increment=3600 | grep duration
91-
sleep 20 && vault token renew "$CAPPED" -increment=3600 | grep duration
90+
sleep 20 && vault token renew -increment=3600 "$CAPPED" | grep duration
91+
sleep 20 && vault token renew -increment=3600 "$CAPPED" | grep duration
9292
```
9393

9494
第一次续约能给到 ~40s(剩余到 explicit_max_ttl 的距离),第二次只能

0 commit comments

Comments
 (0)