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
When reading a Kubernetes object, the request must include the apiVersion, kind, and metadata fields for the object. If the object is found, the response will include the spec and status.
It appears the KubernetesObjectApi.read() type definition was accidentally changed in the 1.0.0 release, so the request and response object are the same.
Argument of type '{ apiVersion: "networking.gke.io/v1"; kind: "ManagedCertificate"; metadata: { name: string; namespace: string; }; }' is not assignable to parameter of type 'GKEManagedCertificate'.
Property 'spec' is missing in type '{ apiVersion: "networking.gke.io/v1"; kind: "ManagedCertificate"; metadata: { name: string; namespace: string; }; }' but required in type 'GKEManagedCertificate'.(2345)
input.tsx(10, 5): 'spec' is declared here.
Expected behavior
For any type, only the apiVersion, kind, and metadata fields should be required.
I'd prefer to do that if it's possible since I think there are additional clean-ups/fixes in that PR.
Thank you! I didn't see that PR before.
It appears all of the other changes from that PR (including tests) are already incorporated into the main branch, see #2129 (comment)
I also took a look just to make sure, and I came to the same conclusion. So I think my linked PR is probably all that needs to be changed to get main to parity unless you saw something else that I missed.
Describe the bug
When reading a Kubernetes object, the request must include the
apiVersion
,kind
, andmetadata
fields for the object. If the object is found, the response will include thespec
andstatus
.It appears the
KubernetesObjectApi.read()
type definition was accidentally changed in the 1.0.0 release, so the request and response object are the same.Old type definition in 0.x:
javascript/src/object.ts
Lines 19 to 27 in 8d4a84c
javascript/src/object.ts
Lines 344 to 350 in 8d4a84c
The request payload is
KubernetesObjectHeader<T>
and the response isT
.New type definition in 1.0.0:
javascript/src/object.ts
Lines 280 to 286 in 27ba0e1
The request payload is
T
and the response isT
.Client Version
N/A
Server Version
N/A
To Reproduce
TS playground: https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAKjgQwM5wNYA50DMoQhwDkAAhgK4BGAplAHY0w2oD0AxgDbA30wC09CABMaxANwAoScD51cydjTgBxANIBRALLJ6yAOY1hAYToxguYO2TM4NAB7N6w9NlQA6NdTqNmqAPJUAFY07PAA3pJw0ShgwABqdKjAEPQAXCS+AO7QGLL67voYNO4prABuAIwSUTF5zhnEOnqGJmYWVjZiUjFwIEzIwjbIGZG9vXr9GagwUPk949GTLGCKNAD807PztdEAvgvRqGCho7vjwoTIsqhbc-T6ANoAuodwB+czNhSom3BjizgSlgHWszAAcsgpnAZvd9G9esDzJYwTQAMowb63GHbB4ImKXEDXegYrGjOCE4l3eY4sk4uHvF746IOOJQGgAFVANGpePOHz20nYqRmQO4vHgAF44IwspgcJ5vMZUpZ9AAKACU7iJxQAgnFjOK+Gq3IraAwmCxAiEwvrgBqpJJcBR6GEUvQ4OzBqYQSiumrlrz9AAaGVQlZrIMa-7nYX0UVIuDSrg8PjuL3CAA86m0ugMRh9yM6zAAfGqAYtkHFElBkqlGtlcvlCsVShAKtVg+devVhI1mvm2r7i2Iu4C+gMhpjyctQ8tjmt3vyHed2TAKAwgWYpIKgA
Results in an error:
Expected behavior
For any type, only the
apiVersion
,kind
, andmetadata
fields should be required.Example Code
Environment (please complete the following information):
Additional context
This only affects type checking, not runtime.
The text was updated successfully, but these errors were encountered: