But the serialization (e.g. when using with client.replace) does not correctly set from field. see the snippet below.
const netPol: V1 NetworkPolicy = {
apiVersion: 'networking.k8s.io/v1',
kind: 'NetworkPolicy',
metadata: {
name: 'test',
namespace: 'default',
},
spec: {
podSelector: {
matchLabels: {
app: 'workspace',
},
},
policyTypes: ['Ingress', 'Egress'],
ingress: [
{
_from: [{
podSelector: {matchLabels: {app: 'foo'}},
}],
ports: [{port: 123}],
},
],
egress: [
{
to: [{
matchLabels: {app: 'bar'},
}],
},
],
},
};
client.create(netPol); // does not include the spec.ingress.from fields
Describe the bug
A network policy resource is correctly deserialized when read from the cluster.
The ingress spec is correctly converted from
fromto_from. See https://github.com/kubernetes-client/javascript/blob/main/src/gen/models/V1NetworkPolicyIngressRule.ts#L24But the serialization (e.g. when using with
client.replace) does not correctly setfromfield. see the snippet below.Client Version
e.g.
1.1.2To Reproduce
See example
Expected behavior
Resource is correctly serialized
Example Code
Environment (please complete the following information):