diff --git a/README.md b/README.md index 6c7e9ce..a074252 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ list all pods: NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds */ 0 /* watch */ ); @@ -130,6 +131,7 @@ list all pods in cluster: NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds */ 0 /* watch */ ); diff --git a/examples/auth_provider/main.c b/examples/auth_provider/main.c index fa65270..7dc91c0 100644 --- a/examples/auth_provider/main.c +++ b/examples/auth_provider/main.c @@ -16,6 +16,7 @@ void list_pod(apiClient_t * apiClient) NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds */ 0 /* watch */ ); diff --git a/examples/configmap/main.c b/examples/configmap/main.c index 2718ef4..6f8aabf 100644 --- a/examples/configmap/main.c +++ b/examples/configmap/main.c @@ -6,7 +6,7 @@ #include #include -void create_configmap(apiClient_t * apiClient, const char *name, const char *namespace_) +void create_configmap(apiClient_t * apiClient, char *name, char *namespace_) { char *api_version = strdup("v1"); char *kind = strdup("ConfigMap"); @@ -37,6 +37,7 @@ void create_configmap(apiClient_t * apiClient, const char *name, const char *nam v1_config_map_t *body = v1_config_map_create(api_version, NULL, data, + 1, kind, meta); @@ -66,7 +67,7 @@ void create_configmap(apiClient_t * apiClient, const char *name, const char *nam } } -void list_configmap(apiClient_t * apiClient, const char *namespace_) +void list_configmap(apiClient_t * apiClient, char *namespace_) { v1_config_map_list_t *config_map_list = CoreV1API_listNamespacedConfigMap(apiClient, namespace_, // char *namespace @@ -77,6 +78,7 @@ void list_configmap(apiClient_t * apiClient, const char *namespace_) NULL, // char * labelSelector 0, // int limit NULL, // char * resourceVersion + NULL, // char * resourceVersionMatch 0, // int timeoutSeconds 0 //int watch ); @@ -111,7 +113,7 @@ void list_configmap(apiClient_t * apiClient, const char *namespace_) } } -void delete_configmap(apiClient_t * apiClient, const char *name, const char *namespace_) +void delete_configmap(apiClient_t * apiClient, char *name, char *namespace_) { v1_status_t *status = CoreV1API_deleteNamespacedConfigMap(apiClient, name, // char *name diff --git a/examples/delete_pod/main.c b/examples/delete_pod/main.c index c279477..45ddaf3 100644 --- a/examples/delete_pod/main.c +++ b/examples/delete_pod/main.c @@ -7,7 +7,7 @@ void delete_a_pod(apiClient_t * apiClient) { - v1_status_t *status = CoreV1API_deleteNamespacedPod(apiClient, + v1_pod_t *pod = CoreV1API_deleteNamespacedPod(apiClient, "test-pod-6", // char *name "default", // char *namespace NULL, // char *pretty @@ -23,14 +23,12 @@ void delete_a_pod(apiClient_t * apiClient) if (200 == apiClient->response_code || 202 == apiClient->response_code) { printf("The pod is deleted successfully.\n"); } else { - if (status && status->message) { - printf("Failed to delete the pod. The error message: %s\n", status->message); - } + printf("Failed to delete the pod.\n"); } - if (status) { - v1_status_free(status); - status = NULL; + if (pod) { + v1_pod_free(pod); + pod = NULL; } } diff --git a/examples/exec_provider/list_pod_by_exec_provider.c b/examples/exec_provider/list_pod_by_exec_provider.c index 29ee7fb..55edde5 100644 --- a/examples/exec_provider/list_pod_by_exec_provider.c +++ b/examples/exec_provider/list_pod_by_exec_provider.c @@ -16,6 +16,7 @@ void list_pod(apiClient_t * apiClient) NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds */ 0 /* watch */ ); diff --git a/examples/list_pod/main.c b/examples/list_pod/main.c index ba9e6a8..33079b2 100644 --- a/examples/list_pod/main.c +++ b/examples/list_pod/main.c @@ -13,6 +13,7 @@ void list_pod(apiClient_t * apiClient) NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds */ 0 /* watch */ ); diff --git a/examples/list_pod_incluster/main.c b/examples/list_pod_incluster/main.c index 03bb2db..85ce37d 100644 --- a/examples/list_pod_incluster/main.c +++ b/examples/list_pod_incluster/main.c @@ -17,6 +17,7 @@ void list_pod(apiClient_t * apiClient) NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds */ 0 /* watch */ ); diff --git a/examples/list_secret/main.c b/examples/list_secret/main.c index 87ab2c5..3477f89 100644 --- a/examples/list_secret/main.c +++ b/examples/list_secret/main.c @@ -16,6 +16,7 @@ void list_secret(apiClient_t * apiClient) NULL, // char * labelSelector 0, // int limit NULL, // char * resourceVersion + NULL, // char * resourceVersionMatch 0, // int timeoutSeconds 0 //int watch ); diff --git a/examples/multi_thread/watch_pod.c b/examples/multi_thread/watch_pod.c index ad899f2..7ae49db 100644 --- a/examples/multi_thread/watch_pod.c +++ b/examples/multi_thread/watch_pod.c @@ -100,6 +100,7 @@ void *watch_pod_thread_func(void *arg) NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds Setting the value to 0 means the watch never stops. */ diff --git a/examples/watch_list_pod/main.c b/examples/watch_list_pod/main.c index 3809888..d02faa2 100644 --- a/examples/watch_list_pod/main.c +++ b/examples/watch_list_pod/main.c @@ -80,6 +80,7 @@ void watch_list_pod(apiClient_t * apiClient) NULL, /* labelSelector */ 0, /* limit */ NULL, /* resourceVersion */ + NULL, /* resourceVersionMatch */ 0, /* timeoutSeconds */ 1 /* watch */ );