lrstanley / vault-unseal

auto-unseal utility for Hashicorp Vault
MIT License
238 stars 32 forks source link

bug: CheckInterval is duplicated #19

Closed MorphBonehunter closed 2 years ago

MorphBonehunter commented 2 years ago

🌧 Describe the problem

In https://github.com/lrstanley/vault-unseal/blob/ccabcff9061d363dd2094be11cb00fd39f11e51d/daemon.go#L26 to the errDelay the CheckInterval is always be added. So the errDelay is minimum = CheckInterval.

In https://github.com/lrstanley/vault-unseal/blob/ccabcff9061d363dd2094be11cb00fd39f11e51d/daemon.go#L42 The errDelay is added to the CheckInterval so the time between the the checks min. is 2x CheckInterval. I would guess this isn't intended.

β›… Expected behavior

The configured CheckInterval is the time between two consecutive checks.

πŸ”„ Minimal reproduction

Set check_interval in yaml:

grep -w check_interval /etc/vault-unseal.yaml
check_interval: 60s

Check the execution times in log:

Aug 29 16:41:11 argos vault-unseal[98884]: timestamp=2022-08-29T16:41:11.250763784+02:00 level=info message="running checks" addr=https://<omit>:8200 environment= version=0.2.3
Aug 29 16:41:11 argos vault-unseal[98884]: timestamp=2022-08-29T16:41:11.272847516+02:00 level=info message="seal status" addr=https://<omit>:8200 environment= version=0.2.3
Aug 29 16:43:11 argos vault-unseal[98884]: timestamp=2022-08-29T16:43:11.273515519+02:00 level=info message="running checks" addr=https://<omit>:8200 environment= version=0.2.3
Aug 29 16:43:11 argos vault-unseal[98884]: timestamp=2022-08-29T16:43:11.313285866+02:00 level=info message="seal status" addr=https://<omit>:8200 environment= version=0.2.3

πŸ’  Version: vault-unseal

vault-unseal version: 0.2.3 [6d0c99ebf553286fd2cbd789dd1c57729c2b5b22] (linux, amd64), compiled 2022-08-25T00:22:00Z

πŸ–₯ Version: Operating system

linux/other

βš™ Additional context

No response

🀝 Requirements