Skip to content

Commit 248341b

Browse files
authored
Merge pull request #280 from brendandburns/automated-generate-67769f3a
Update to get latest code generator fixes
2 parents 67e736a + 22fd092 commit 248341b

File tree

8 files changed

+58
-14
lines changed

8 files changed

+58
-14
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Requested Commit/Tag : master
2-
Actual Commit : 4402d836bb85f95c2d634844fdffde90bb5dd186
1+
Requested Commit/Tag : HEAD
2+
Actual Commit : fcc83db0f8f3e9ba8bf58219ef9c75b177587521
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.14.0-SNAPSHOT
1+
7.15.0-SNAPSHOT

kubernetes/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,11 @@ include(PreTarget.cmake OPTIONAL)
15831583
set(PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
15841584

15851585
# Add library with project file with project name as library name
1586-
add_library(${pkgName} ${SRCS} ${HDRS})
1586+
if(NOT BUILD_STATIC_LIBS)
1587+
add_library(${pkgName} ${SRCS} ${HDRS})
1588+
else()
1589+
add_library(${pkgName} STATIC ${SRCS} ${HDRS})
1590+
endif()
15871591
# Link dependent libraries
15881592
if(NOT CMAKE_VERSION VERSION_LESS 3.4)
15891593
target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto)

kubernetes/PreTarget.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(PROJECT_VERSION_MAJOR 0)
22
set(PROJECT_VERSION_MINOR 13)
3-
set(PROJECT_VERSION_PATCH 0)
3+
set(PROJECT_VERSION_PATCH 1)
44

55
set(PROJECT_PACKAGE_DESCRIPTION_SUMMARY "The Kubernetes client library for the C programming language.")
66
set(PROJECT_PACKAGE_VENDOR "https://github.com/kubernetes-client")

kubernetes/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
55

66
- API version: release-1.33
77
- Package version:
8-
- Generator version: 7.14.0-SNAPSHOT
8+
- Generator version: 7.15.0-SNAPSHOT
99
- Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen
1010

1111
## Installation
12-
You'll need the `curl 7.58.0` package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later.
12+
You'll need the `curl 7.61.1` package in order to build the API. To have code formatted nicely, you also need to have uncrustify version 0.67 or later.
1313

1414
# Prerequisites
1515

16-
## Install the `curl 7.58.0` package with the following command on Linux.
16+
## Install the `curl 7.61.1` package with the following command on Linux.
1717
```bash
1818
sudo apt remove curl
19-
wget http://curl.haxx.se/download/curl-7.58.0.tar.gz
20-
tar -xvf curl-7.58.0.tar.gz
21-
cd curl-7.58.0/
19+
wget http://curl.haxx.se/download/curl-7.61.1.tar.gz
20+
tar -xvf curl-7.61.1.tar.gz
21+
cd curl-7.61.1/
2222
./configure
2323
make
2424
sudo make install

kubernetes/include/apiClient.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,20 @@ typedef struct sslConfig_t {
1919
/* 1 -- skip ssl verify for server certificate */
2020
} sslConfig_t;
2121

22+
typedef struct curlConfig_t {
23+
long verbose; /* 0 -- disable verbose (default) */
24+
/* 1 -- enable verbose */
25+
int keepalive; /* 0 -- disable keepalive (default) */
26+
/* 1 -- enable keepalive */
27+
long keepidle; /* keep-alive idle time: default to 120 seconds */
28+
long keepintvl; /* interval time between keep-alive probes: default to 60 seconds */
29+
} curlConfig_t;
30+
2231
typedef struct apiClient_t {
2332
char *basePath;
2433
sslConfig_t *sslConfig;
34+
curlConfig_t *curlConfig;
35+
void (*curl_pre_invoke_func)(CURL *);
2536
void *dataReceived;
2637
long dataReceivedLen;
2738
void (*data_callback_func)(void **, long *);

kubernetes/src/apiClient.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ apiClient_t *apiClient_create() {
1010
apiClient_t *apiClient = malloc(sizeof(apiClient_t));
1111
apiClient->basePath = strdup("http://localhost");
1212
apiClient->sslConfig = NULL;
13+
apiClient->curlConfig = NULL;
14+
apiClient->curl_pre_invoke_func = NULL;
1315
apiClient->dataReceived = NULL;
1416
apiClient->dataReceivedLen = 0;
1517
apiClient->data_callback_func = NULL;
@@ -38,6 +40,13 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath
3840
apiClient->sslConfig = NULL;
3941
}
4042

43+
apiClient->curlConfig = malloc(sizeof(curlConfig_t));
44+
apiClient->curlConfig->verbose = 0;
45+
apiClient->curlConfig->keepalive = 0;
46+
apiClient->curlConfig->keepidle = 120;
47+
apiClient->curlConfig->keepintvl = 60;
48+
49+
apiClient->curl_pre_invoke_func = NULL;
4150
apiClient->dataReceived = NULL;
4251
apiClient->dataReceivedLen = 0;
4352
apiClient->data_callback_func = NULL;
@@ -80,6 +89,14 @@ void apiClient_free(apiClient_t *apiClient) {
8089
}
8190
list_freeList(apiClient->apiKeys_BearerToken);
8291
}
92+
93+
if(apiClient->curlConfig) {
94+
free(apiClient->curlConfig);
95+
apiClient->curlConfig = NULL;
96+
}
97+
98+
apiClient->curl_pre_invoke_func = NULL;
99+
83100
free(apiClient);
84101
}
85102

@@ -416,13 +433,25 @@ void apiClient_invoke(apiClient_t *apiClient,
416433
CURLOPT_WRITEDATA,
417434
apiClient);
418435
curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers);
419-
curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable
420436

421437

422438
if(bodyParameters != NULL) {
423439
postData(handle, bodyParameters, bodyParametersLength);
424440
}
425441

442+
if(apiClient->curlConfig != NULL) {
443+
if(apiClient->curlConfig->keepalive == 1) {
444+
curl_easy_setopt(handle, CURLOPT_TCP_KEEPALIVE, 1L);
445+
curl_easy_setopt(handle, CURLOPT_TCP_KEEPIDLE, apiClient->curlConfig->keepidle);
446+
curl_easy_setopt(handle, CURLOPT_TCP_KEEPINTVL, apiClient->curlConfig->keepintvl);
447+
}
448+
curl_easy_setopt(handle, CURLOPT_VERBOSE, apiClient->curlConfig->verbose);
449+
}
450+
451+
if(apiClient->curl_pre_invoke_func) {
452+
apiClient->curl_pre_invoke_func(handle);
453+
}
454+
426455
res = curl_easy_perform(handle);
427456

428457
curl_slist_free_all(headers);

settings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
export KUBERNETES_BRANCH="release-1.33"
33

44
# client version is not currently used by the code generator.
5-
export CLIENT_VERSION="0.13.0"
5+
export CLIENT_VERSION="0.13.1"
66

77
# Name of the release package
88
export PACKAGE_NAME="client"
99

1010
# OpenAPI-Generator branch/tag to generate the client library
11-
export OPENAPI_GENERATOR_COMMIT="master"
11+
export OPENAPI_GENERATOR_COMMIT="HEAD"
1212

1313
export USERNAME=kubernetes

0 commit comments

Comments
 (0)