-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: credential refresh on config change (#56)
* Refactor integration tests (#49) * feat: make integration test idempotent * refactor: encapsulate logic for tests, moving connect-to-minio logic into a reusable helper so it can be used by multiple tests * refactor: add arg for access/secret_key in connect_client_to_server * feat: make connection test attempts auto-retry using tenacity.retry * fix: unpin black to fix linting/formatting * fix: credential refresh on config change (#50) * feat: add hash of config to env vars Fixes #47 This adds a hash of the current config to environment variables in order to trigger creating a new pod whenever config changes. This ensures minio will restart whenever someone does `juju config minio access-key=newKey` or similar. This also adds unit tests for the new code Implementation: * refactor handling the default value for secret-key (moved to `_get_secret_key()`) to make it reusable * add `_generate_config_hash()` to create the hash of the current config * fix: _get_secret_key try/except caught wrong exception Fixes bug where we catch errors about missing data in self._stored. Was using `except KeyError`, but `self._stored` raises an `AttributeError` if data is not available. * fix: linting/formatting * feat: Add integration test for credential refresh * fix: test_refresh_credentials Updates test_refresh_credentials to use the refactored connect_client_to_server.
- Loading branch information
1 parent
f45681b
commit ff66ebc
Showing
4 changed files
with
200 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# Copyright 2021 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
|
||
pytest | ||
pyyaml | ||
flake8 | ||
black | ||
flake8-copyright<0.3 | ||
pytest | ||
pyyaml | ||
tenacity<8.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters