📣
TiDB Cloud Premium 开放公测中。为企业级工作负载提供无限扩展、即时弹性伸缩和高级安全保障。此页面由 AI 自动翻译,英文原文请见此处。

ti fs-vault replace-secret



使用本地目录中的文件替换一个 Secret 中的所有字段。

语法

ti fs-vault replace-secret --from-directory <string> --secret-path <string> [--dry-run] [--file-system-id <string>] [--fs-token <string>] [--help] [--version]

选项

  • --from-directory <string>:其中文件将成为 Secret 字段的目录。[required]
  • --secret-path <string>:规范的 Vault 路径,格式为 /n/vault/<secret-name>。例如,以 db-prod 创建的 Secret 路径为 /n/vault/db-prod[required]
  • --dry-run:验证请求而不应用更改。
  • --file-system-id <string>:选择文件系统。你也可以设置 TI_FS_FILE_SYSTEM_ID
  • --fs-token <string>:设置 Filesystem 访问令牌。如果省略此选项,命令会使用 TI_FS_TOKEN 环境变量。如果两者都未提供,命令会使用为所选 Filesystem 本地存储的令牌。
  • --help:显示帮助信息。
  • --version:显示版本信息。

有关所有命令共享的选项,请参见全局选项

示例

  • 从目录替换 Secret:

    # Replace all fields with files loaded from the selected directory. ti fs-vault replace-secret --file-system-id <file-system-id> --secret-path /n/vault/db-prod --from-directory ./secret-fields
  • 预览 Secret 替换:

    # Validate the replacement source without changing the stored secret. ti fs-vault replace-secret --file-system-id <file-system-id> --secret-path /n/vault/db-prod --from-directory ./secret-fields --dry-run

文档内容是否有帮助?