fix dateformat rejected (#611)
* fix dateformat rejected * fix format * fix format
This commit is contained in:
@@ -130,6 +130,7 @@ namespace k8s
|
|||||||
partial void CustomInitialize()
|
partial void CustomInitialize()
|
||||||
{
|
{
|
||||||
DeserializationSettings.Converters.Add(new V1Status.V1StatusObjectViewConverter());
|
DeserializationSettings.Converters.Add(new V1Status.V1StatusObjectViewConverter());
|
||||||
|
SerializationSettings.DateFormatString = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.ffffffK";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>A <see cref="DelegatingHandler"/> that simply forwards a request with no further processing.</summary>
|
/// <summary>A <see cref="DelegatingHandler"/> that simply forwards a request with no further processing.</summary>
|
||||||
|
|||||||
@@ -326,6 +326,35 @@ namespace k8s.E2E
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MinikubeFact]
|
||||||
|
public async Task DatetimeFieldTest()
|
||||||
|
{
|
||||||
|
var kubernetes = CreateClient();
|
||||||
|
|
||||||
|
await kubernetes.CreateNamespacedEventAsync(
|
||||||
|
new Corev1Event(
|
||||||
|
new V1ObjectReference(
|
||||||
|
"v1alpha1",
|
||||||
|
kind: "Test",
|
||||||
|
name: "test",
|
||||||
|
namespaceProperty: "default",
|
||||||
|
resourceVersion: "1",
|
||||||
|
uid: "1"),
|
||||||
|
new V1ObjectMeta()
|
||||||
|
{
|
||||||
|
GenerateName = "started-",
|
||||||
|
},
|
||||||
|
action: "STARTED",
|
||||||
|
type: "Normal",
|
||||||
|
reason: "STARTED",
|
||||||
|
message: "Started",
|
||||||
|
eventTime: DateTime.Now,
|
||||||
|
firstTimestamp: DateTime.Now,
|
||||||
|
lastTimestamp: DateTime.Now,
|
||||||
|
reportingComponent: "37",
|
||||||
|
reportingInstance: "38"), "default").ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
private static IKubernetes CreateClient()
|
private static IKubernetes CreateClient()
|
||||||
{
|
{
|
||||||
return new Kubernetes(KubernetesClientConfiguration.BuildDefaultConfig());
|
return new Kubernetes(KubernetesClientConfiguration.BuildDefaultConfig());
|
||||||
|
|||||||
Reference in New Issue
Block a user