Fix examples

This commit is contained in:
Brendan Burns
2025-02-11 20:04:48 +00:00
parent b1181ee814
commit c419fa7bec
4 changed files with 12 additions and 2 deletions

View File

@@ -122,6 +122,7 @@ void delete_configmap(apiClient_t * apiClient, char *name, char *namespace_)
NULL, // char *pretty
NULL, // char *dryRun
NULL, // int *gracePeriodSeconds
NULL, // int *ignoreStoreReadErrorWithClusterBreakingPotential
NULL, // int *orphanDependents
NULL, // char *propagationPolicy
NULL // v1_delete_options_t *body

View File

@@ -13,6 +13,7 @@ void delete_a_pod(apiClient_t * apiClient)
NULL, // char *pretty
NULL, // char *dryRun
NULL, // int *gracePeriodSeconds
NULL, // int* ignoreStoreReadErrorWithClusterBreakingPotential
NULL, // int *orphanDependents
NULL, // char *propagationPolicy
NULL // v1_delete_options_t *body

View File

@@ -11,7 +11,11 @@ int shc_request(char **p_http_response, int *p_http_response_length, char *type,
fprintf(stderr, "%s: Cannot create http client. [%s].\n", fname, strerror(errno));
return -1;
}
apiClient_invoke(http_client, NULL, NULL, NULL, NULL, NULL, contentType, post_data, strlen(post_data), type);
size_t len = 0;
if (post_data != NULL) {
len = strlen(post_data);
}
apiClient_invoke(http_client, NULL, NULL, NULL, NULL, NULL, contentType, post_data, len, type);
int rc = http_client->response_code;
switch (rc) {

View File

@@ -60,7 +60,11 @@ void makeResourcePath(char* path, genericClient_t *client, const char* name) {
char* callInternal(genericClient_t *client,
const char *path, list_t *queryParameters, list_t *headerParameters, list_t *formParameters, list_t *headerType, list_t *contentType, const char *body, const char *method)
{
apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, strlen(body), method);
size_t len = 0;
if (body != NULL) {
len = strlen(body);
}
apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, len, method);
if (client->client->response_code == 401) {
return NULL;