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

Support configuring multiple namespace for multiNamespaceMode #35639

Closed

Conversation

hussein-awala
Copy link
Member

This PR adds a new value, airflowNamespaces to create some resources usually used by the K8S worker/K8S pod when creating them in another namespace.

I'm trying to refactorize the method:

{{- $workersNamespaces := list }}
{{- if .Values.multiNamespaceMode }}
  {{- range $namespace := .Values.airflowNamespaces }}
    {{- $workersNamespaces = mustAppend $workersNamespaces ($namespace | quote) }}
  {{- end }}
{{- end }}
{{- if not (has (.Release.Namespace | quote) $workersNamespaces) }}
    {{ $workersNamespaces = mustPrepend $workersNamespaces (.Release.Namespace | quote) }}
{{- end }}

and move it to _helpers, but I have a problem with the returned value (string), which is badly parsed in the templates.

@shohamy7
Copy link
Contributor

Hi! @hussein-awala
I am interested in this PR, so I will try to help :)
I encountered the problem with returning list from define in the past, it seems like it's not possible as define helpers only returns strings.
Maybe you can workaround this issue by converting the list to and from json as suggested in the following SO issue: https://stackoverflow.com/questions/77438391/return-a-list-variable-from-a-helm-helper-function
It seems a bit hacky but it does the trick.
Let me know what you think!

Copy link

github-actions bot commented Feb 2, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Feb 2, 2024
@hussein-awala hussein-awala removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Feb 6, 2024
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Mar 23, 2024
@github-actions github-actions bot closed this Mar 29, 2024
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 stale Stale PRs per the .github/workflows/stale.yml policy file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Launch Pod/job in separate namespace and support in helm chart
2 participants