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

New feature: network policies (1.9.0) #49

Merged
merged 10 commits into from
Oct 26, 2024
Merged

Conversation

anthosz
Copy link
Contributor

@anthosz anthosz commented Oct 24, 2024

Descriptive description goes here.

Tasks:

  • I've made changes
  • I've bumped chart's version in Chart.yaml
  • I've added changes to charts CHANGELOG.md
  • I've run helm-docs

Fixes: #50

@MaikuMori
Copy link
Owner

It's currently failing test:

Error: UPGRADE FAILED: template: gotenberg/templates/networkpolicy.yaml:1:14: executing "gotenberg/templates/networkpolicy.yaml" at <.Values.networkPolicy.enabled>: nil pointer evaluating interface {}.enabled

This happens because of how helm upgrades charts. To fix it you need to check if networkPolicy exists before checking if enabled in truthy.

This issue only happens on upgrades, not fresh installs.

@anthosz
Copy link
Contributor Author

anthosz commented Oct 25, 2024

It's currently failing test:

Error: UPGRADE FAILED: template: gotenberg/templates/networkpolicy.yaml:1:14: executing "gotenberg/templates/networkpolicy.yaml" at <.Values.networkPolicy.enabled>: nil pointer evaluating interface {}.enabled

This happens because of how helm upgrades charts. To fix it you need to check if networkPolicy exists before checking if enabled in truthy.

This issue only happens on upgrades, not fresh installs.

Patch pushed + aligned with master

Copy link
Owner

@MaikuMori MaikuMori left a comment

Choose a reason for hiding this comment

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

I'm going to add a couple changes too so it's bundled in the same release.

charts/gotenberg/templates/networkpolicy.yaml Outdated Show resolved Hide resolved
charts/gotenberg/templates/networkpolicy.yaml Outdated Show resolved Hide resolved
- Ingress
- Egress
ingress:
{{- if .Values.networkPolicy.allowIngress }}
Copy link
Owner

Choose a reason for hiding this comment

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

This seems a bit weird way to structure it, but I think it's ok for now. We can always accept a PR to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I copy paste from my PR for varnish, varnish/helm-varnish-cache#24

It's not really clean but it allow to unblock when we use strict mode on cni :)

TODO: add a default schema that took into account the port & probably a matchexpressions based on ns or pod selector

Thank you!

@MaikuMori MaikuMori changed the title New feature: network policies New feature: network policies (1.9.0) Oct 26, 2024
@MaikuMori MaikuMori mentioned this pull request Oct 26, 2024
5 tasks
@MaikuMori MaikuMori merged commit 4c5a606 into MaikuMori:master Oct 26, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests - Allow to add custom annotations on pod level
2 participants