Skip to content

Commit 218bb31

Browse files
committed
Refactor Pod API calls to use 'Create' and 'Update' methods for consistency
1 parent 3085283 commit 218bb31

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/LibKubernetesGenerator/GeneralNameHelper.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,8 @@ public static string GetActionName(OpenApiOperation apiOperation, string resourc
169169
var operationId = apiOperation.OperationId.ToPascalCase();
170170
var replacements = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
171171
{
172-
{ "Replace", "Put" },
172+
{ "Replace", "Update" },
173173
{ "Read", "Get" },
174-
{ "Create", "Post" },
175174
};
176175

177176
foreach (var replacement in replacements)

tests/E2E.Tests/MinikubeTests.cs

Lines changed: 2 additions & 2 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.Pod.PostAsync(
622+
await clientSet.CoreV1.Pod.CreateAsync(
623623
new V1Pod()
624624
{
625625
Metadata = new V1ObjectMeta { Name = podName, Labels = new Dictionary<string, string> { { "place", "holder" }, }, },
@@ -656,7 +656,7 @@ await clientSet.CoreV1.Pod
656656
{
657657
var pod = await clientSet.CoreV1.Pod.GetAsync(podName, namespaceParameter).ConfigureAwait(false);
658658
pod.Spec.Containers[0].Image = "httpd";
659-
await clientSet.CoreV1.Pod.PutAsync(pod, podName, namespaceParameter).ConfigureAwait(false);
659+
await clientSet.CoreV1.Pod.UpdateAsync(pod, podName, namespaceParameter).ConfigureAwait(false);
660660

661661
pod = await clientSet.CoreV1.Pod.GetAsync(podName, namespaceParameter).ConfigureAwait(false);
662662
Assert.Equal("httpd", pod.Spec.Containers[0].Image);

0 commit comments

Comments
 (0)