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(helm-chart): dags gitsync credentials #43264

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

tobimichael96
Copy link

@tobimichael96 tobimichael96 commented Oct 22, 2024

closes: #43247


This adds a condition to the env vars being added to the gitsync sidecar. The expected keys are in sync with what is documentation here: https://github.com/romsharon98/airflow/blob/main/chart/values.yaml#L2738

Copy link

boring-cyborg bot commented Oct 22, 2024

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

Copy link
Contributor

@romsharon98 romsharon98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add unit test for this?

@tobimichael96
Copy link
Author

Can you add unit test for this?

I added them here: 2b70391

@romsharon98
Copy link
Contributor

romsharon98 commented Oct 22, 2024

It was a really quick solution, great one! @tobimichael96

chart/templates/_helpers.yaml Outdated Show resolved Hide resolved
valueFrom:
secretKeyRef:
name: {{ .Values.dags.gitSync.credentialsSecret | quote }}
key: GITSYNC_USERNAME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We at least need to add a newsfragment that these will no longer work and it'll use GIT_SYNC_X instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. But I have no idea where and how to put that. Feel free to add/suggest something.

Copy link
Contributor

@romsharon98 romsharon98 Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a question, what you think about a solution like this

{{- $gitUsernameKey := if (hasKey .Values.dags.gitSync.credentialsSecret "GITSYNC_USERNAME") "GITSYNC_USERNAME" "GIT_SYNC_USERNAME" -}}
key: $gitUsernameKey

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but it's in the secret, not in values so that won't work :(

@tobimichael96, you can read about how to do a newsfragment over in the contributing docs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the fragment, let me know if that works for you.

@tobimichael96
Copy link
Author

Any updates on this here? From my perspective it could be merged.

@romsharon98
Copy link
Contributor

Any updates on this here? From my perspective it could be merged.

Looks good to me.
@jedcunningham

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but as discussed it, we should likely bundle it with a number of other backwards-incompatible changes to the helm chart and relase a new MAJOR release then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitSync Credentials Secret requires 2 different sets of data fields
4 participants