Update Program.cs (#240)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
9f1669b0cb
commit
a349292fc2
@@ -20,12 +20,12 @@ namespace patch
|
|||||||
var name = pod.Metadata.Name;
|
var name = pod.Metadata.Name;
|
||||||
PrintLabels(pod);
|
PrintLabels(pod);
|
||||||
|
|
||||||
var newlables = new Dictionary<string, string>(pod.Metadata.Labels)
|
var newlabels = new Dictionary<string, string>(pod.Metadata.Labels)
|
||||||
{
|
{
|
||||||
["test"] = "test"
|
["test"] = "test"
|
||||||
};
|
};
|
||||||
var patch = new JsonPatchDocument<V1Pod>();
|
var patch = new JsonPatchDocument<V1Pod>();
|
||||||
patch.Replace(e => e.Metadata.Labels, newlables);
|
patch.Replace(e => e.Metadata.Labels, newlabels);
|
||||||
client.PatchNamespacedPod(new V1Patch(patch), name, "default");
|
client.PatchNamespacedPod(new V1Patch(patch), name, "default");
|
||||||
|
|
||||||
PrintLabels(client.ReadNamespacedPod(name, "default"));
|
PrintLabels(client.ReadNamespacedPod(name, "default"));
|
||||||
|
|||||||
Reference in New Issue
Block a user