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

wrong type for value expected string; got float64 #2434

Closed
olalonde opened this issue May 12, 2017 · 2 comments
Closed

wrong type for value expected string; got float64 #2434

olalonde opened this issue May 12, 2017 · 2 comments

Comments

@olalonde
Copy link
Contributor

olalonde commented May 12, 2017

I'm using --set to set facebook.appId when installing/upgrading:

     --set "facebook.appId=1333333337"

I am getting this error:

Error: UPGRADE FAILED: render error in "app/templates/secrets.yaml": template: app/templates/secrets.yaml:69:37: 
executing "app/templates/secrets.yaml" at <b64enc>: wrong typefor value; expected string; got float64

Here's the template code that uses the value:

apiVersion: v1
kind: Secret
metadata:
  name: secret-facebook
type: Opaque
data:
  appID: {{ .Values.facebook.appId | b64enc | quote }}
  appSecret: {{ .Values.facebook.appSecret | b64enc | quote }}

I'm guessing that Helm guesses that 1333333337 in facebook.appId=1333333337 is a float64 whereas I need a way to coerce it to a string so that it's accepted by base64. Is that possible? I tried --set "facebook.appId=\"1333333337\"" and --set "facebook.appId='1333333337'" but it didn't work as expected.

@olalonde
Copy link
Contributor Author

Looks like duplicate of #1707

@aliasmee
Copy link

@olalonde
try this.

{{ .Values.dbInfo.db_port | replace ":" "" | b64enc }}

iffyuva added a commit to dockup/helm-charts that referenced this issue Nov 14, 2019
Source id is a number usually, so passing a number to base64enc throws up.
There is a workaround which is implemented here. For more details, check
this issue: helm/helm#2434
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

No branches or pull requests

4 participants