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

Error with Type Mismatch in deployment-worker.yaml Template #294

Open
alaturqua opened this issue Jan 20, 2025 · 4 comments
Open

Error with Type Mismatch in deployment-worker.yaml Template #294

alaturqua opened this issue Jan 20, 2025 · 4 comments

Comments

@alaturqua
Copy link
Contributor

alaturqua commented Jan 20, 2025

Description

The Helm chart produces a type mismatch error when deploying the worker component due to an incompatible comparison between a float and an integer in the deployment-worker.yaml template. The issue arises in the following logic:

<gt (mulf 2.0 .Values.worker.gracefulShutdown.gracePeriodSeconds) .Values.worker.terminationGracePeriodSeconds>

When the result of mulf 2.0 is a float and .Values.worker.terminationGracePeriodSeconds is an integer, the gt function fails because it cannot compare different types.


Steps to Reproduce

  1. Configure worker.gracefulShutdown.gracePeriodSeconds via helm command
  2. Deploy the Helm chart:
    helm install my-trino trino/trino \
     --set "worker.gracefulShutdown.enabled=true" \
     --set "worker.terminationGracePeriodSeconds=600"
  3. Observe the following error:
     Error: template: /charts/trino/templates/deployment-worker.yaml:111:58: executing "/charts/trino/templates/deployment-worker.yaml" at <gt 
    (mulf 2.0 .Values.worker.gracefulShutdown.gracePeriodSeconds) .Values.worker.terminationGracePeriodSeconds>: error calling gt: incompatible 
    types for comparison
    

Expected Behavior

The comparison should work without error, ensuring compatibility between worker.gracefulShutdown.gracePeriodSeconds and worker.terminationGracePeriodSeconds.

@nineinchnick
Copy link
Member

Interesting, there's a test that uses integers, and it passed: https://github.com/trinodb/charts/blob/main/tests/trino/test-graceful-shutdown-values.yaml#L4

Weirdly, it works with only gracePeriodSeconds:

helm template trino/trino \
 --set "worker.gracefulShutdown.enabled=true" \
 --set "worker.gracefulShutdown.gracePeriodSeconds=15"

But doesn't work when specifying worker.terminationGracePeriodSeconds, even with the default value of 30:

helm template trino/trino \
 --set "worker.gracefulShutdown.enabled=true" \
 --set "worker.terminationGracePeriodSeconds=30" \
 --set "worker.gracefulShutdown.gracePeriodSeconds=15"

@nineinchnick
Copy link
Member

I guess the default is typed as int, and it requires a cast when specified in --set since it's a string.

@alaturqua
Copy link
Contributor Author

--set sets usually as int or infers it. To set explicitly string, I have been using --set-string

@nineinchnick
Copy link
Member

It works as expected with --set-json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants