Update examples as the openapi spec of Kubenretes 1.23.5 changes

This commit is contained in:
Hui Yu
2022-04-12 22:14:28 +08:00
parent 50b553f732
commit c8678cbe7e
3 changed files with 5 additions and 4 deletions

View File

@@ -46,6 +46,7 @@ void create_configmap(apiClient_t * apiClient, char *name, char *namespace_)
body,
NULL,
NULL,
NULL,
NULL);
printf("%s: The return code of HTTP request=%ld\n", __func__, apiClient->response_code);

View File

@@ -23,7 +23,7 @@ void create_a_pod(apiClient_t * apiClient)
v1_container_t *con = calloc(1, sizeof(v1_container_t));
con->name = strdup("my-container");
con->image = strdup("ubuntu:latest");
con->image_pull_policy = strdup("IfNotPresent");
con->image_pull_policy = kubernetes_v1_container_IMAGEPULLPOLICY_IfNotPresent;
/* set command for container */
list_t *commandlist = list_createList();
@@ -60,7 +60,7 @@ void create_a_pod(apiClient_t * apiClient)
podinfo->spec->volumes = volumelist;
/* call API in libkubernetes to create pod */
v1_pod_t *apod = CoreV1API_createNamespacedPod(apiClient, namespace, podinfo, NULL, NULL, NULL);
v1_pod_t *apod = CoreV1API_createNamespacedPod(apiClient, namespace, podinfo, NULL, NULL, NULL, NULL);
printf("code=%ld\n", apiClient->response_code);
v1_pod_free(apod);

View File

@@ -18,7 +18,7 @@ static void create_a_pod(apiClient_t * apiClient)
v1_container_t *con = calloc(1, sizeof(v1_container_t));
con->name = strdup("my-container");
con->image = strdup("ubuntu:latest");
con->image_pull_policy = strdup("IfNotPresent");
con->image_pull_policy = kubernetes_v1_container_IMAGEPULLPOLICY_IfNotPresent;
/* set command for container */
list_t *commandlist = list_createList();
@@ -55,7 +55,7 @@ static void create_a_pod(apiClient_t * apiClient)
podinfo->spec->volumes = volumelist;
/* call API in libkubernetes to create pod */
v1_pod_t *apod = CoreV1API_createNamespacedPod(apiClient, namespace, podinfo, NULL, NULL, NULL);
v1_pod_t *apod = CoreV1API_createNamespacedPod(apiClient, namespace, podinfo, NULL, NULL, NULL, NULL);
printf("code=%ld\n", apiClient->response_code);
v1_pod_free(apod);