Tony Vec
10/03/2022, 1:44 PMSecretsManager
within tests with the goal of not accidentally using secrets in /etc/secrets
. We have a way of doing this now (I’ll add what we have in 🧵) but was hoping to see if there’s a standard way of doing this@pytest.fixture(autouse=True)
def setup_flyte_secrets_dir(mocker: MockerFixture):
with TemporaryDirectory() as temp_dir:
os.environ["FLYTE_SECRETS_DEFAULT_DIR"] = temp_dir
# setting the ENV var wasn't enough since current_context may have been already initialized
secret_manager = SecretsManager()
mocker.patch.object(current_context(), "_secrets_manager", secret_manager)
# More setup stuff
Samhita Alla