rancher: Helm install fails with 'incompatible types for comparison' when using Helm v2.15.0(-rc)

What kind of request is this (question/bug/enhancement/feature request): bug

Steps to reproduce (least amount of steps as possible): Use latest RC for Helm (v2.15.0-rc2) and try to install Rancher

Result:

Error: render error in "rancher/templates/deployment.yaml": template: rancher/templates/deployment.yaml:76:7: executing "rancher/templates/deployment.yaml" at <gt .Values.auditLog.level 0.0>: error calling gt: incompatible types for comparison

Other details that may be helpful: Helm merged https://github.com/helm/helm/pull/6010 where they move away from float64 when parsing numbers and now json.Number is returned.

Workarounds that have been applied in other cases (parsing to int) also don’t work as anything parsed will just be 0.

What seems to work is {{- if gt (.Values.auditLog.level | toString | atoi) 0 }} but this needs some additional testing

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (6 by maintainers)

Most upvoted comments

not sure if this is the proper fix…

  1. Several lines in deployment.yml had a comparison like {{- if gt .Values.auditLog.level 0.0 }} which caused the incompatible types issue. Changed all lines to {{- if gt (float64 (toString (.Values.auditLog.level))) 0.0 }}

This seemed to allow the upgrade to complete successfully…