Closed vascofernandes closed 5 years ago
Hi - thanks for reporting this, I’m going to take a quick look at the OpenAPI document and see what it says we should expect there. What version of K8s are you using?
Ok, this is a little odd - according to the K8s docs, StatusV1.Status
is always supposed to be a string (Success
or Failure
):
https://kubernetes.io/docs/reference/federation/v1/definitions/#_v1_status
Let me play around with an actual instance of the K8s API and see what I get...
Oh, right, never mind - I just realised (need my morning coffee!), this relates to #55.
I will check on the version.
No worries - I'm about to add a fix for this (we recently updated the other resource clients to handle this, but I must have somehow missed the v1/Namespace
client).
The problem was that some successful delete operations can return either a StatusV1
or a model representing the resource state before it was deleted (in this case a NamespaceV1
, which has the correct properties for deserialisation). Only way to tell is to check the kind
and apiVersion
in the response body. Which we do now, for certain operations.
See https://github.com/tintoy/dotnet-kube-client/commit/9d11ac1e7f3f376f810797e2e3d26deaf787ec02 for details of what was fixed. I'll push out a new version shortly.
Just for completeness :)
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.5", GitCommit:"753b2dbc622f5cc417845f0ff8a77f539a4213ea", GitTreeState:"clean", BuildDate:"2018-11-26T14:31:35Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
And thanks for the new version.
You're welcome :)
I have published v2.2.4 (but it may take a while for NuGet to index the packages).
(if you need packages sooner that NuGet can index them, they are also published to this MyGet feed: https://www.myget.org/F/dotnet-kube-client/api/v3/index.json)
Tested and confirmed to be working fine.
Thanks!
I am trying to delete a namespace using
The api call actually works and k8s does what it needs to do. It is the deserialization of the response that fails. Some specifically the Status property.
Here is the JSON response from k8s:
Notice at the very end
"status":{"phase":"Terminating"}}
The current model
StatusV1
has typestring
in the propertyStatus
: StatusV1.cs#L47Thanks.