Update examples as the openapi spec of Kubenretes 1.23.5 changes
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user