pegasystems / pega-helm-charts

Orchestrate a Pega Platform™ deployment by using Docker, Kubernetes, and Helm to take advantage of Pega Platform Cloud Choice flexibility.
https://community.pega.com/knowledgebase/articles/cloud-choice
Apache License 2.0
125 stars 200 forks source link

GKE ingress render error for batch tier when no ingress config specified #774

Open misterdorito opened 3 months ago

misterdorito commented 3 months ago

Describe the bug When deploying to GKE and not specifying an ingress for batch tier (which nominally wouldn't have one by convention) the following error happens:

Error: INSTALLATION FAILED: template: pega/templates/pega-tier-ingress.yaml:4:78: executing "pega/templates/pega-tier-ingress.yaml" at <$dep.ingress.enabled>: nil pointer evaluating interface {}.enabled

To Reproduce Deploy to GKE and don't specify ingress configuration for the batch tier.

Expected behavior There should be no error in the event that the ingress configuration is not provided.

Chart version Current chart (master branch).

Server (if applicable, please complete the following information): This happens on GKE deployments

Additional context The issue is that the 'and' operator in go template language is not a short-circuit operator so it evaluates all operands (some of which cause the error).

misterdorito commented 3 months ago

In golang 1.18, the "and" and "or" operators behaviors were changed to work like short-circuit operators (for example, && and || operators in Java or C).

helm 3.10 adopted golang 1.18.

This problem will be reproducible in versions of helm < 3.10.

Given the current state of supported k8s api versions by the various vendors supported by this helm chart, it probably makes the most sense to use a version of helm that is more recent than 3.10. If for some reason, this is not possible, this particular issue can be worked around by specifying .ingress.enabled=false for any tiers not providing an ingress.