You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrectly parsing Knative Service YAML in 1.4.0 #2670
Describe the bug
When using the loadYaml method to parse a Knative Service YAML, version 1.4.0 incorrectly handles the parsing and loses the spec content. This appears to be a regression as it works correctly in version 1.3.0.
It appears that the parser might be incorrectly treating the Knative Service as a native Kubernetes Service, causing it to lose the Knative-specific spec configuration.
changed the title [-]loadYaml regression: Incorrectly parsing Knative Service YAML in v1.4.0[/-][+]loadYaml regression: Incorrectly parsing Knative Service YAML in 1.4.0[/+]on Oct 20, 2025
changed the title [-]loadYaml regression: Incorrectly parsing Knative Service YAML in 1.4.0[/-][+]Incorrectly parsing Knative Service YAML in 1.4.0[/+]on Oct 20, 2025
Yeah, in general it is tricky to parse non-native extension objects as part of this library. The "right" thing to do is probably to enumerate all of the loaded objects using the discovery APIs and then possibly dynamically generate the right object models based on those schemas, but that's pretty complicated.
Activity
[-]loadYaml regression: Incorrectly parsing Knative Service YAML in v1.4.0[/-][+]loadYaml regression: Incorrectly parsing Knative Service YAML in 1.4.0[/+][-]loadYaml regression: Incorrectly parsing Knative Service YAML in 1.4.0[/-][+]Incorrectly parsing Knative Service YAML in 1.4.0[/+]brendandburns commentedon Oct 20, 2025
Yeah, this is caused by this here:
https://github.com/kubernetes-client/javascript/blob/main/src/util.ts#L168
In general, parsing to non-built in objects isn't really well supported, we should augment the loadYaml function so that it considers the API group.
0x5457 commentedon Oct 20, 2025
The issue affects not only
loadYaml/loadAllYamlbut alsoKubernetesObjectApi.read()Additional Test Case
brendandburns commentedon Oct 22, 2025
Yeah, in general it is tricky to parse non-native extension objects as part of this library. The "right" thing to do is probably to enumerate all of the loaded objects using the discovery APIs and then possibly dynamically generate the right object models based on those schemas, but that's pretty complicated.
This is an area where we could use help improving things, but for now using the raw client:
https://github.com/kubernetes-client/javascript/blob/main/examples/raw-example.js
May be a better way until there are structured objects for non-native objects.
brendandburns commentedon Nov 8, 2025
Closing via #2688