Skip to content

Commit 56f63e5

Browse files
committed
Fix order of parameters in Pod API calls for consistency
1 parent 05da1c4 commit 56f63e5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/E2E.Tests/MinikubeTests.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ async Task Cleanup()
619619

620620
// create + list
621621
{
622-
await clientSet.CoreV1.Pods.PutAsync(
622+
await clientSet.CoreV1.Pods.PostAsync(
623623
new V1Pod()
624624
{
625625
Metadata = new V1ObjectMeta { Name = podName, Labels = new Dictionary<string, string> { { "place", "holder" }, }, },
@@ -628,7 +628,6 @@ await clientSet.CoreV1.Pods.PutAsync(
628628
Containers = new[] { new V1Container() { Name = "k8scsharp-e2e", Image = "nginx", }, },
629629
},
630630
},
631-
podName,
632631
namespaceParameter).ConfigureAwait(false);
633632

634633
var pods = await clientSet.CoreV1.Pods.ListAsync(namespaceParameter).ConfigureAwait(false);
@@ -637,7 +636,7 @@ await clientSet.CoreV1.Pods.PutAsync(
637636

638637
// replace + get
639638
{
640-
var pod = await clientSet.CoreV1.Pods.GetAsync(namespaceParameter, podName).ConfigureAwait(false);
639+
var pod = await clientSet.CoreV1.Pods.GetAsync(podName, namespaceParameter).ConfigureAwait(false);
641640
var old = JsonSerializer.SerializeToDocument(pod);
642641

643642
var newLabels = new Dictionary<string, string>(pod.Metadata.Labels) { ["test"] = "clinetset-test-jsonpatch" };
@@ -646,18 +645,20 @@ await clientSet.CoreV1.Pods.PutAsync(
646645
var expected = JsonSerializer.SerializeToDocument(pod);
647646
var patch = old.CreatePatch(expected);
648647

649-
await clientSet.CoreV1.Pods.PatchAsync(new V1Patch(patch, V1Patch.PatchType.JsonPatch), namespaceParameter, podName).ConfigureAwait(false);
648+
await clientSet.CoreV1.Pods
649+
.PatchAsync(new V1Patch(patch, V1Patch.PatchType.JsonPatch), podName, namespaceParameter)
650+
.ConfigureAwait(false);
650651
var pods = await clientSet.CoreV1.Pods.ListAsync(namespaceParameter).ConfigureAwait(false);
651652
Assert.Contains(pods.Items, p => p.Labels().Contains(new KeyValuePair<string, string>("test", "clinetset-test-jsonpatch")));
652653
}
653654

654655
// replace + get
655656
{
656-
var pod = await clientSet.CoreV1.Pods.GetAsync(namespaceParameter, podName).ConfigureAwait(false);
657+
var pod = await clientSet.CoreV1.Pods.GetAsync(podName, namespaceParameter).ConfigureAwait(false);
657658
pod.Spec.Containers[0].Image = "httpd";
658-
await clientSet.CoreV1.Pods.PutAsync(pod, namespaceParameter, podName).ConfigureAwait(false);
659+
await clientSet.CoreV1.Pods.PutAsync(pod, podName, namespaceParameter).ConfigureAwait(false);
659660

660-
pod = await clientSet.CoreV1.Pods.GetAsync(namespaceParameter, podName).ConfigureAwait(false);
661+
pod = await clientSet.CoreV1.Pods.GetAsync(podName, namespaceParameter).ConfigureAwait(false);
661662
Assert.Equal("httpd", pod.Spec.Containers[0].Image);
662663
}
663664

@@ -669,7 +670,7 @@ await clientSet.CoreV1.Pods.PutAsync(
669670
{
670671
try
671672
{
672-
await clientSet.CoreV1.Pods.DeleteAsync(namespaceParameter, podName).ConfigureAwait(false);
673+
await clientSet.CoreV1.Pods.DeleteAsync(podName, namespaceParameter).ConfigureAwait(false);
673674
}
674675
catch (HttpOperationException e)
675676
{

0 commit comments

Comments
 (0)