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

[Bug]: Snapshot agent local_max_space 0 is not allowed #2298

Open
smirta opened this issue Jul 18, 2024 · 0 comments
Open

[Bug]: Snapshot agent local_max_space 0 is not allowed #2298

smirta opened this issue Jul 18, 2024 · 0 comments
Labels

Comments

@smirta
Copy link

smirta commented Jul 18, 2024

Terraform Core Version

1.10.0

Terraform Vault Provider Version

4.3.0

Vault Server Version

1.17.2

Affected Resource(s)

  • vault_raft_snapshot_agent_config

Expected Behavior

Not entirely sure since this code part is not source available. But it seems that setting local_max_space to zero means no limit for storage used by snapshots when set manually in Vault.

Actual Behavior

According to the referenced code bits, setting local_max_space to zero is not allowed.

Relevant Error/Panic Output Snippet

vault_raft_snapshot_agent_config.local: Creating...
╷
│ Error: specified local storage without setting local_max_space
│ 
│   with vault_raft_snapshot_agent_config.local,
│   on snapshot-auto.tf line 1, in resource "vault_raft_snapshot_agent_config" "local":
│    1: resource "vault_raft_snapshot_agent_config" "local" {

Terraform Configuration Files

irrelevant

Steps to Reproduce

resource "vault_raft_snapshot_agent_config" "local" {
interval_seconds = 86400 # 24h
retain = 7
path_prefix = "/opt/vault/snapshots/"
storage_type = "local"
local_max_space = 0
}

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

I'd remove v != 0 or set it to v >= 0 in

if v, ok := d.GetOk("local_max_space"); ok && v != 0 {
if my assumptions are correct.

@smirta smirta added the bug label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant