Closed johnlabarge closed 5 years ago
you need a .withKind("pod")
I think, I'll update the example.
Here's the unit test that validates that load
works correctly.
So this is the issue. I'm trying to use this client as part of a Jenkins plugin that is loaded via reflection. This causes some strange behavior with static initialization method initModelMap which expects the model classes to be available via classloader (imagine that). Still tracking down exact cause and trying to figure out a workaround.
Duplicate of #474
See https://gist.github.com/johnlabarge/00105981f156811d612bb5aadce7dbfc
The output trying to run this example is: java.io.IOException: Missing kind in YAML file! at io.kubernetes.client.util.Yaml.modelMapper (Yaml.java:461) at io.kubernetes.client.util.Yaml.load (Yaml.java:184) at io.kubernetes.client.util.Yaml.load (Yaml.java:172) at io.kubernetes.client.examples.YamlExample.main (YamlExample.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282) at java.lang.Thread.run (Thread.java:748)
This is because the generated pod file doesn't have an API entry. But even if it does, it will be lower case and not match the upper case format so that when it loads from the YAML there is no matching api. I'll supply another gist.