-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.
Description
Describe the bug
When using the Yaml.dump
method to serialize a K8S object (eg - V1Pod
) several warnings related to CRD schema attributes are output from snakeyaml
.
The same issue occurs when using the Yaml.loadAs
method (which is actually the method I am using in production).
See example code and output below.
Client Version
18.0.1
Kubernetes Version
N/A
Java Version
Java 17
To Reproduce
Run the YAML code example
Expected behavior
The output should not contain warnings related to missing schema attributes for CRDs.
KubeConfig
N/A
Operating System
Linux
Additional context
The (example) code I am running is below:
public class YamlExample {
public static void main(String[] args) throws IOException, ApiException, ClassNotFoundException {
V1Pod pod =
new V1PodBuilder()
.withNewMetadata()
.withName("apod")
.endMetadata()
.withNewSpec()
.addNewContainer()
.withName("www")
.withImage("nginx")
.withNewResources()
.withLimits(new HashMap<>())
.endResources()
.endContainer()
.endSpec()
.build();
System.out.println(Yaml.dump(pod));
}
}
The output from the example code is below:
Jul 27, 2023 1:23:33 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for io.kubernetes.client.openapi.models.V1JSONSchemaProps.x-kubernetes-embedded-resource
Jul 27, 2023 1:23:33 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for io.kubernetes.client.openapi.models.V1JSONSchemaProps.x-kubernetes-int-or-string
Jul 27, 2023 1:23:33 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for io.kubernetes.client.openapi.models.V1JSONSchemaProps.x-kubernetes-list-map-keys
Jul 27, 2023 1:23:33 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for io.kubernetes.client.openapi.models.V1JSONSchemaProps.x-kubernetes-list-type
Jul 27, 2023 1:23:33 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for io.kubernetes.client.openapi.models.V1JSONSchemaProps.x-kubernetes-map-type
Jul 27, 2023 1:23:33 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for io.kubernetes.client.openapi.models.V1JSONSchemaProps.x-kubernetes-preserve-unknown-fields
metadata:
name: apod
spec:
containers:
- image: nginx
name: www
resources:
limits: {}
Process finished with exit code 0
shamoh, youngledo, tonylsw and martin-traverse
Metadata
Metadata
Assignees
Labels
good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.