Skip to content

Comments

Apply namespace filter for OBI#1221

Merged
jakub-racek-swi merged 6 commits intomasterfrom
obi-namespace-filter
Dec 10, 2025
Merged

Apply namespace filter for OBI#1221
jakub-racek-swi merged 6 commits intomasterfrom
obi-namespace-filter

Conversation

@jakub-racek-swi
Copy link
Contributor

@jakub-racek-swi jakub-racek-swi commented Dec 3, 2025

Configmap update. There's no regex filter in the OBI configmap so I've added a pipeline filter as well.

include: include configured, exclude everything
exclude: exclude configured, include everything
else: include everything

@github-actions github-actions bot added the helm label Dec 3, 2025
@jakub-racek-swi jakub-racek-swi marked this pull request as ready for review December 4, 2025 08:43
@jakub-racek-swi jakub-racek-swi requested a review from a team as a code owner December 4, 2025 08:43
{{- range .Values.cluster.filter.exclude_namespaces }}
- k8s_namespace: {{ quote . }}
{{- end }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

if we both include and exclude some namespaces, then we will see this:

- k8s_namespace: "*"
- k8s_namespace: XYZ

or maybe I'm missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@murad-sw Having configured both include and exclude is undefined behavior, and we do not even allow it in wizard, so I'd say handling this case is unnecessary.

{{- if (not (empty .Values.cluster.filter.include_namespaces))}}
- k8s_namespace: "*"
{{- end }}
{{- if or (not (empty .Values.cluster.filter.exclude_namespaces)) (not (empty .Values.cluster.filter.exclude_namespaces_regex)) }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see exclude_namespaces_regex used, only checked in this condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed that check, it should behave as expected now.

@jakub-racek-swi jakub-racek-swi merged commit 88e75a2 into master Dec 10, 2025
18 checks passed
@jakub-racek-swi jakub-racek-swi deleted the obi-namespace-filter branch December 10, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants