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

Fix separator getting added to variables_prefix when empty #26749

Merged
merged 3 commits into from
Sep 30, 2022

Conversation

rajaths010494
Copy link
Contributor

@rajaths010494 rajaths010494 commented Sep 28, 2022

Describe the bug
azure key vault adds a - between the key prefix and the secret name when it reads it from the azure key vault. It does this even when the variables prefix is "" so secrets end up named -my-secret instead of my-secret.

To Reproduce
Follow the instructions to set up an azure key vault integrated install with a variables_prefix of "".
Create a secret named -my-var in the azure key vault.
Use the example dag provided in the docs with Variable.get("my-var")
You will see that it fetches the variable because it is incorrectly mapping my-var to -my-var instead of my-var.

Expected Behaviour
connections_prefix and variables_prefix don't add a leading - when they are set to "".


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@rajaths010494 rajaths010494 changed the title fix separator getting added to variables_prefix Fix separator getting added to variables_prefix when empty Sep 28, 2022
@rajaths010494 rajaths010494 marked this pull request as ready for review September 28, 2022 16:42
@rajaths010494 rajaths010494 force-pushed the fix_azure_variables_prefix branch from 291350b to 4cf0d04 Compare September 29, 2022 04:58
@rajaths010494
Copy link
Contributor Author

tests/providers/google/cloud/utils/test_credentials_provider.py::TestGetGcpCredentialsAndProjectId::test_disable_logging: Failed: DID NOT RAISE <class 'AssertionError'> is failing but i haven't changed anything in Google cloud.

@rajaths010494 rajaths010494 force-pushed the fix_azure_variables_prefix branch from 4cf0d04 to a44f4fa Compare September 29, 2022 15:10
rajaths010494 and others added 3 commits September 30, 2022 14:08
azure key vault adds a - between the key prefix and the secret name when it reads it from azure key vault. It does this even when the key prefix is "" so secrets end up named -my-secret instead of my-secret.
Co-authored-by: Niko <onikolas@amazon.com>
@rajaths010494 rajaths010494 force-pushed the fix_azure_variables_prefix branch from a44f4fa to 55cf79e Compare September 30, 2022 08:38
@potiuk potiuk merged commit 32434a1 into apache:main Sep 30, 2022
@rajaths010494 rajaths010494 deleted the fix_azure_variables_prefix branch November 16, 2022 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants