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

Template doesn't support ${{ }} #959

Closed
ckanner opened this issue Dec 21, 2017 · 5 comments · Fixed by #1977
Closed

Template doesn't support ${{ }} #959

ckanner opened this issue Dec 21, 2017 · 5 comments · Fixed by #1977

Comments

@ckanner
Copy link

ckanner commented Dec 21, 2017

A Template has a number parameter PORT. If i use it with ${{PORT}}, the kubernetes client doesn't support. But When i use it with ${PORT}, it success.

@stale
Copy link

stale bot commented Aug 6, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale label Aug 6, 2019
@novakov-alexey-zz
Copy link

Latest release still has this issue, no matter what I use {{}} or {} braces

Version:
"io.fabric8" % "openshift-client" % "4.4.1"

Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.lang.Integer` from String "${BROKER_REPLICAS}": not a valid Integer value
 at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: io.fabric8.openshift.api.model.Template["objects"]->java.util.ArrayList[4]->io.fabric8.kubernetes.api.model.apps.StatefulSet["spec"]->io.fabric8.kubernetes.api.model.apps.StatefulSetSpec["replicas"])
  at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)
  at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1549)
  at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:911)
  at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer._parseInteger(NumberDeserializers.java:522)
  at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:474)
  at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:452)
  at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
  at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
  at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3984)
  at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2276)
  at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:2758)
  at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:81)
  at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:33)
  at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
  at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
  at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
  at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
  at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
  at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3984)
  at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2276)
  at com.fasterxml.jackson.databind.ObjectMapper.treeToValue(ObjectMapper.java:2758)
  at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:81)
  at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:33)

my template snippet:

- name: BROKER_REPLICAS
  required: true
  value: 3
spec:
    podManagementPolicy: OrderedReady
    replicas: ${BROKER_REPLICAS}

@noamichael
Copy link

This is a pretty big issue. The entire point of using templates is that they can be parameterized, and the client library needs to support that. The issue is twofold: the parsing code assumes only a single curly brace, and it always assumes the value of the interpolation will be a string.

See #746 and #448.

@rohanKanojia
Copy link
Member

@noamichael : Hi, Thanks for noticing. I can prioritize it for 4.7.0 if you can give me some test cases which are reproducing this, and what use cases in template context are still unsupported.

@stale
Copy link

stale bot commented Jan 16, 2020

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

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

Successfully merging a pull request may close this issue.

5 participants