kubernetes-models
Version:
51 lines (50 loc) • 1.31 kB
JavaScript
import { register } from "@kubernetes-models/validate";
import { addSchema as IoK8sApimachineryPkgUtilIntstrIntOrString } from "@kubernetes-models/apimachinery/_schemas/IoK8sApimachineryPkgUtilIntstrIntOrString";
const schema = {
"properties": {
"appProtocol": {
"type": "string",
"nullable": true
},
"name": {
"type": "string",
"nullable": true
},
"nodePort": {
"format": "int32",
"type": "integer",
"nullable": true
},
"port": {
"format": "int32",
"type": "integer"
},
"protocol": {
"enum": [
"SCTP",
"TCP",
"UDP"
],
"type": "string",
"nullable": true
},
"targetPort": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.util.intstr.IntOrString#"
},
{
"type": "null"
}
]
}
},
"required": [
"port"
],
"type": "object"
};
export function addSchema() {
IoK8sApimachineryPkgUtilIntstrIntOrString();
register("io.k8s.api.core.v1.ServicePort", schema);
}