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

deserialize value of type int from String #4109

Closed
ho-yasla opened this issue Apr 29, 2022 · 6 comments · Fixed by #4292
Closed

deserialize value of type int from String #4109

ho-yasla opened this issue Apr 29, 2022 · 6 comments · Fixed by #4292
Assignees
Labels
Milestone

Comments

@ho-yasla
Copy link

ho-yasla commented Apr 29, 2022

template = client.templates().inNamespace(NamespaceName).withName(templateName).get();

Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `int` from String "${{NUMBER_OF_INSTANCES}}": not a valid `int` value
 at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.fabric8.openshift.api.model.Template["objects"]->java.util.ArrayList[3]->io.fabric8.kubernetes.api.model.apps.StatefulSet["spec"]->io.fabric8.kubernetes.api.model.apps.StatefulSetSpec["replicas"])
<dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>openshift-client</artifactId>
            <version>5.12.2</version>
</dependency>
@shawkins
Copy link
Contributor

This is a known issue with retrieving templates in their object form - it could be addressed by #4034

The workaround for now is that you either need to use withParameters to supply the template values, or retrieve as a generic kubernetes resource.

@ho-yasla
Copy link
Author

This is a known issue with retrieving templates in their object form - it could be addressed by #4034

The workaround for now is that you either need to use withParameters to supply the template values, or retrieve as a generic kubernetes resource.

Can you provide an example source for a workaround?

@shawkins
Copy link
Contributor

shawkins commented May 2, 2022

To replace the parameter values:

client.templates().inNamespace(NamespaceName).withName(templateName).process(map)

To read the template as a generic

client.genericKubernetesResources("template.openshift.io/v1", "Template").inNamespace(NamespaceName).withName(templateName).get()

or

client.genericKubernetesResources(ResourceDefinitionContext.fromResourceType(Template.class)).withName(templateName).get()

@rohanKanojia
Copy link
Member

@ho-yasla : polite ping, Did the suggestion from Steven worked for your use case?

@rohanKanojia rohanKanojia added the Waiting on feedback Issues that require feedback from User/Other community members label May 16, 2022
@stale
Copy link

stale bot commented Aug 14, 2022

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 14, 2022
@manusa manusa added this to the 6.1.0 milestone Aug 23, 2022
@manusa manusa added bug and removed question Waiting on feedback Issues that require feedback from User/Other community members status/stale labels Aug 23, 2022
@manusa manusa linked a pull request Aug 23, 2022 that will close this issue
11 tasks
@manusa
Copy link
Member

manusa commented Aug 23, 2022

Fixed by #4292

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

Successfully merging a pull request may close this issue.

4 participants