Skip to content

Commit c419fa7

Browse files
committed
Fix examples
1 parent b1181ee commit c419fa7

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

Diff for: examples/configmap/main.c

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ void delete_configmap(apiClient_t * apiClient, char *name, char *namespace_)
122122
NULL, // char *pretty
123123
NULL, // char *dryRun
124124
NULL, // int *gracePeriodSeconds
125+
NULL, // int *ignoreStoreReadErrorWithClusterBreakingPotential
125126
NULL, // int *orphanDependents
126127
NULL, // char *propagationPolicy
127128
NULL // v1_delete_options_t *body

Diff for: examples/delete_pod/main.c

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ void delete_a_pod(apiClient_t * apiClient)
1313
NULL, // char *pretty
1414
NULL, // char *dryRun
1515
NULL, // int *gracePeriodSeconds
16+
NULL, // int* ignoreStoreReadErrorWithClusterBreakingPotential
1617
NULL, // int *orphanDependents
1718
NULL, // char *propagationPolicy
1819
NULL // v1_delete_options_t *body

Diff for: kubernetes/config/authn_plugin/authn_plugin_util.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ int shc_request(char **p_http_response, int *p_http_response_length, char *type,
1111
fprintf(stderr, "%s: Cannot create http client. [%s].\n", fname, strerror(errno));
1212
return -1;
1313
}
14-
apiClient_invoke(http_client, NULL, NULL, NULL, NULL, NULL, contentType, post_data, strlen(post_data), type);
14+
size_t len = 0;
15+
if (post_data != NULL) {
16+
len = strlen(post_data);
17+
}
18+
apiClient_invoke(http_client, NULL, NULL, NULL, NULL, NULL, contentType, post_data, len, type);
1519

1620
int rc = http_client->response_code;
1721
switch (rc) {

Diff for: kubernetes/src/generic.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ void makeResourcePath(char* path, genericClient_t *client, const char* name) {
6060
char* callInternal(genericClient_t *client,
6161
const char *path, list_t *queryParameters, list_t *headerParameters, list_t *formParameters, list_t *headerType, list_t *contentType, const char *body, const char *method)
6262
{
63-
apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, strlen(body), method);
63+
size_t len = 0;
64+
if (body != NULL) {
65+
len = strlen(body);
66+
}
67+
apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, len, method);
6468

6569
if (client->client->response_code == 401) {
6670
return NULL;

0 commit comments

Comments
 (0)