Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm chart identifies numeric string as a number when creating a namespace

I am trying to create a helm deployment where one of the templates is creating a namespace as below

apiVersion : v1
kind : Namespace
metadata :
  name : "{{ .Values.productId }}"

I am passing the value for the productId in values file as follows:

productId: "32345"

I get the following error when I do helm install/upgrade

Error: unable to build kubernetes objects from release manifest: unable to decode "": json: cannot unmarshal number into Go struct field ObjectMeta.metadata.namespace of type string helm.go:84: [debug] unable to decode "": json: cannot unmarshal number into Go struct field ObjectMeta.metadata.namespace of type string

I am using helm version 3.8.2. Not sure what is wrong.

like image 991
Raj Sharma Avatar asked Nov 29 '25 17:11

Raj Sharma


1 Answers

response from @Blender Fox worked for me name: {{ .Values.productId | quote }}

like image 181
user3118920 Avatar answered Dec 01 '25 07:12

user3118920