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
While it probably isn't an issue most of the time, i'm encountering conflicts with reusing PodTemplateSpec, specially for httpGetAction for probes ends up like this:
port:
description: >- Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.type: stringformat: int-or-string
whereas they should probably end like this:
port:
description: >- Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.x-kubernetes-int-or-string: true
If left as is, you have to put quotes around the port number to be allowed to create an instance of a CRD resource with this property, however when you then try to create a pod from this spec, it will fail as quoted values are considered to the names of the named ports.
The text was updated successfully, but these errors were encountered:
zlepper
added a commit
to zlepper/k8s-openapi
that referenced
this issue
Feb 5, 2024
"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","format":"int-or-string","type":"string"},
... so I'm surprised it wants a different thing for user-provided specs.
I agree, it's kinda f'ed up.. however it's probably another lovely case of Kubernetes not using crd's to represent its own stuff, and thus the behave differently :/
According to https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#intorstring types that are of the format "int-or-string" should be typed like this in the schema:
However right now they are typed as:
While it probably isn't an issue most of the time, i'm encountering conflicts with reusing PodTemplateSpec, specially for
httpGetAction
for probes ends up like this:whereas they should probably end like this:
If left as is, you have to put quotes around the port number to be allowed to create an instance of a CRD resource with this property, however when you then try to create a pod from this spec, it will fail as quoted values are considered to the names of the named ports.
The text was updated successfully, but these errors were encountered: