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

Raise errors if both externalService and service are set #319

Merged
merged 4 commits into from
Mar 8, 2022
Merged

Raise errors if both externalService and service are set #319

merged 4 commits into from
Mar 8, 2022

Conversation

aaronandrino
Copy link
Contributor

@aaronandrino aaronandrino commented Mar 4, 2022

Description

Fixes #318

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How has this been tested?

kind create cluster --name posthog
kubectx kind-posthog

# fails as expected
helm upgrade --install posthog-test \
	~/git/charts-clickhouse/charts/posthog \
	--set cloud=private \
	--set postgresql.enabled=true \
	--set externalPostgresql.postgresqlHost=test123.local

# works
helm upgrade --install posthog-test \
	~/git/charts-clickhouse/charts/posthog \
	--set cloud=private \
	--set postgresql.enabled=true \
	--set externalPostgresql.postgresqlHost=""

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

# :TRICKY: This template raises an error if any externalService is configured without service.enabled being false in values.yaml.
# It doesn't actually define any real kubernetes resources
{{- end -}}
{{- include "snippet.error-on-both-externalService-and-service-enabled" . -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor request: please merge this file with charts/posthog/templates/error-on-removed-values.yaml to charts/posthog/templates/error-on-invalid-values.yaml, merge the tpl file with the other tpl file.

After that this looks great to me. It would be awesome to add some helm-unittest coverage here, but not required immediately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I couldn't add an error test case because of this bug, but it should be possible to do so once the bug fix is released.

@macobo macobo added the bump patch Updates chart version by 0.0.1 label Mar 8, 2022
@macobo
Copy link
Contributor

macobo commented Mar 8, 2022

This is great! Thank you for the contribution 🙇

@macobo macobo merged commit a55dcf2 into PostHog:main Mar 8, 2022
@macobo macobo mentioned this pull request Mar 8, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Updates chart version by 0.0.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raise an error if externalService is used without service.enabled being false
2 participants