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

TextNode cannot be cast to ObjectNode #1478

Closed
tprus opened this issue Apr 4, 2019 · 6 comments
Closed

TextNode cannot be cast to ObjectNode #1478

tprus opened this issue Apr 4, 2019 · 6 comments

Comments

@tprus
Copy link

tprus commented Apr 4, 2019

There is problem with parsing YAML config with JSON element like that:

apiVersion: v1
data:
  staging.json: |
    {
      "type": "service_account",
      ...
    }

It throws error:

java.lang.ClassCastException: com.fasterxml.jackson.databind.node.TextNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
	at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:73)
	at io.fabric8.kubernetes.internal.KubernetesDeserializer.deserialize(KubernetesDeserializer.java:32)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3079)
	at io.fabric8.kubernetes.api.KubernetesHelper.loadYaml(KubernetesHelper.java:513)

The purpose of that part is to be able to pipe json file so when we mount the configmap we can have a json file with the content from it.

It is well documented in kubernetes
https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-directories

I'm able to apply it manually using kubectl apply -f

@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
@rohanKanojia
Copy link
Member

seems like a valid bug.

@stale stale bot removed the status/stale label Aug 6, 2019
@stale
Copy link

stale bot commented Nov 4, 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 Nov 4, 2019
@stale stale bot closed this as completed Nov 11, 2019
@sztwiorok
Copy link

what about this issue? is it solved?

@shawkins
Copy link
Contributor

No longer occurs on latest. Not sure when it was actually addressed.

@manusa
Copy link
Member

manusa commented Oct 27, 2021

Probably fixed by #2646 (#2510). We are doing two passes now to deserialize YAML. Snakeyaml is used first/instead since there were a few issues with Jackson.

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

No branches or pull requests

5 participants