Skip to content

Commit b1181ee

Browse files
committed
Updates for new generated code. Mostly cleanups.
1 parent d72a1c8 commit b1181ee

File tree

7 files changed

+27
-2
lines changed

7 files changed

+27
-2
lines changed

kubernetes/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
cmake_minimum_required (VERSION 2.6...3.10.2)
22
project (CGenerator C)
33

4+
enable_language(C)
5+
enable_language(CXX)
6+
47
cmake_policy(SET CMP0063 NEW)
58

69
set(CMAKE_C_VISIBILITY_PRESET default)

kubernetes/config/authn_plugin/authn_plugin_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ 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, type);
14+
apiClient_invoke(http_client, NULL, NULL, NULL, NULL, NULL, contentType, post_data, strlen(post_data), type);
1515

1616
int rc = http_client->response_code;
1717
switch (rc) {

kubernetes/config/kube_config.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
#define KUBE_CONFIG_DEFAULT_LOCATION "%s/.kube/config"
3131

32+
int load_kube_config_common(char **pBasePath, sslConfig_t ** pSslConfig, list_t ** pApiKeys, kubeconfig_t * kubeconfig);
33+
3234
static int setBasePath(char **pBasePath, char *basePath)
3335
{
3436
char *_basePath = strdup(basePath);

kubernetes/config/kube_config_model.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#include "kube_config_model.h"
22
#include <stdlib.h>
33

4+
void kubeconfig_free_string_list(char **string_list, int count);
5+
void kubeconfig_free_string_map_list(keyValuePair_t ** map_list, int count);
6+
7+
char *kubeconfig_mk_cert_key_tempfile(const char *data);
8+
49
void kubeconfig_free_string_list(char **string_list, int count)
510
{
611
if (string_list && count > 0) {

kubernetes/config/kube_config_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#endif
1414
#include "../include/apiClient.h"
1515

16+
char *kubeconfig_mk_cert_key_tempfile(const char *data);
17+
void unsetSslConfig(sslConfig_t * sslConfig);
18+
void clear_and_free_string_pair_list(list_t * list);
19+
1620
static bool is_cert_or_key_base64_encoded(const char *data)
1721
{
1822
if (NULL == strstr(data, "BEGIN")) {

kubernetes/config/kube_config_yaml.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ mapping :: = MAPPING - START(node node) * MAPPING - END
5858

5959
#define VALUE_TRUE_LOWERCASE_STRING "true"
6060

61+
int append_key_stringseq_to_mapping_node(yaml_document_t * output_document, int parent_node, const char *key_string, char **strings, int strings_count);
62+
int append_auth_provider_config_to_mapping_node(yaml_document_t * output_document, int parent_node, const kubeconfig_property_t * auth_provider_config);
63+
int append_key_kvpseq_to_mapping_node(yaml_document_t * output_document, int parent_node, const char *key_string, keyValuePair_t ** kvps, int kvps_count);
64+
65+
6166
static char *load_file_content(const char *path)
6267
{
6368

kubernetes/src/generic.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
#include "../include/generic.h"
33
#include "../include/utils.h"
44

5+
void makeNamespacedResourcePath(char* path, genericClient_t *client, const char* namespace, const char* name);
6+
void makeResourcePath(char* path, genericClient_t *client, const char* name);
7+
char* callInternal(genericClient_t *client,
8+
const char *path, list_t *queryParameters, list_t *headerParameters, list_t *formParameters, list_t *headerType, list_t *contentType, const char *body, const char *method);
9+
char *callSimplifiedInternal(genericClient_t *client, const char *path, const char *method, const char *body);
10+
511
genericClient_t* genericClient_create(apiClient_t *client, const char *apiGroup, const char* apiVersion, const char* resourcePlural) {
612
genericClient_t *result = malloc(sizeof(genericClient_t));
713
result->client = client;
@@ -54,7 +60,7 @@ void makeResourcePath(char* path, genericClient_t *client, const char* name) {
5460
char* callInternal(genericClient_t *client,
5561
const char *path, list_t *queryParameters, list_t *headerParameters, list_t *formParameters, list_t *headerType, list_t *contentType, const char *body, const char *method)
5662
{
57-
apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, method);
63+
apiClient_invoke(client->client, path, queryParameters, headerParameters, formParameters, headerType, contentType, body, strlen(body), method);
5864

5965
if (client->client->response_code == 401) {
6066
return NULL;

0 commit comments

Comments
 (0)