origin: Cannot specify integer/bool/base64 types in templates

It is not currently possible to specify integer types in template parameters.

For example, we want to be able to specify a parameter:

- name: N_MIAMI
  description: Number of Miami pods
  value: 1

where N_MIAMI will actually be fed to a replication controller to specify the number of replicas. As written, this fails during oc process with: error: unable to load “agree21-template.yaml”: json: cannot unmarshal number into Go value of type string

We can fix this with:

- name: N_MIAMI
  description: Number of Miami pods
  value: "1"

which now successfully processes. However, the output now contains:

“replicas”: “1” which fails on creation with: json: cannot unmarshall string into Go value of type int

A possible fix would be to be able to specify the expected parameter type (string, int or float should cover it) in the parameter definition.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 3
  • Comments: 23 (18 by maintainers)

Commits related to this issue

Most upvoted comments

As referenced here: https://github.com/openshift/origin/pull/11068

There is a workaround using ${{ VARIABLE }} instead of ${ VARIABLE}, but I missed that. Hopefully this comment helps somebody in the same situation

In my case I had to remove the spaces as well: ${{VARIABLE}}. @alwinmark thanks for pointing me in the right direction.