From 22fd092f99e85b90d8c5e143dce00998d8c903c5 Mon Sep 17 00:00:00 2001 From: Brendan Burns <5751682+brendandburns@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:28:30 +0000 Subject: [PATCH] Automated openapi generation from release-1.33 --- kubernetes/.openapi-generator/COMMIT | 4 ++-- kubernetes/.openapi-generator/VERSION | 2 +- kubernetes/CMakeLists.txt | 6 +++++- kubernetes/PreTarget.cmake | 2 +- kubernetes/README.md | 12 +++++------ kubernetes/include/apiClient.h | 11 ++++++++++ kubernetes/src/apiClient.c | 31 ++++++++++++++++++++++++++- settings | 4 ++-- 8 files changed, 58 insertions(+), 14 deletions(-) diff --git a/kubernetes/.openapi-generator/COMMIT b/kubernetes/.openapi-generator/COMMIT index 2655865..9ca120a 100644 --- a/kubernetes/.openapi-generator/COMMIT +++ b/kubernetes/.openapi-generator/COMMIT @@ -1,2 +1,2 @@ -Requested Commit/Tag : master -Actual Commit : 4402d836bb85f95c2d634844fdffde90bb5dd186 +Requested Commit/Tag : HEAD +Actual Commit : fcc83db0f8f3e9ba8bf58219ef9c75b177587521 diff --git a/kubernetes/.openapi-generator/VERSION b/kubernetes/.openapi-generator/VERSION index 4c631cf..fc74d6c 100644 --- a/kubernetes/.openapi-generator/VERSION +++ b/kubernetes/.openapi-generator/VERSION @@ -1 +1 @@ -7.14.0-SNAPSHOT +7.15.0-SNAPSHOT diff --git a/kubernetes/CMakeLists.txt b/kubernetes/CMakeLists.txt index 4615b63..013a226 100644 --- a/kubernetes/CMakeLists.txt +++ b/kubernetes/CMakeLists.txt @@ -1583,7 +1583,11 @@ include(PreTarget.cmake OPTIONAL) set(PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") # Add library with project file with project name as library name -add_library(${pkgName} ${SRCS} ${HDRS}) +if(NOT BUILD_STATIC_LIBS) + add_library(${pkgName} ${SRCS} ${HDRS}) +else() + add_library(${pkgName} STATIC ${SRCS} ${HDRS}) +endif() # Link dependent libraries if(NOT CMAKE_VERSION VERSION_LESS 3.4) target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto) diff --git a/kubernetes/PreTarget.cmake b/kubernetes/PreTarget.cmake index 9d9761d..e804008 100644 --- a/kubernetes/PreTarget.cmake +++ b/kubernetes/PreTarget.cmake @@ -1,6 +1,6 @@ set(PROJECT_VERSION_MAJOR 0) set(PROJECT_VERSION_MINOR 13) -set(PROJECT_VERSION_PATCH 0) +set(PROJECT_VERSION_PATCH 1) set(PROJECT_PACKAGE_DESCRIPTION_SUMMARY "The Kubernetes client library for the C programming language.") set(PROJECT_PACKAGE_VENDOR "https://github.com/kubernetes-client") diff --git a/kubernetes/README.md b/kubernetes/README.md index dadaee5..0bd8306 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -5,20 +5,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat - API version: release-1.33 - Package version: -- Generator version: 7.14.0-SNAPSHOT +- Generator version: 7.15.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen ## Installation -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. +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. # Prerequisites -## Install the `curl 7.58.0` package with the following command on Linux. +## Install the `curl 7.61.1` package with the following command on Linux. ```bash sudo apt remove curl -wget http://curl.haxx.se/download/curl-7.58.0.tar.gz -tar -xvf curl-7.58.0.tar.gz -cd curl-7.58.0/ +wget http://curl.haxx.se/download/curl-7.61.1.tar.gz +tar -xvf curl-7.61.1.tar.gz +cd curl-7.61.1/ ./configure make sudo make install diff --git a/kubernetes/include/apiClient.h b/kubernetes/include/apiClient.h index a51d300..72c718b 100644 --- a/kubernetes/include/apiClient.h +++ b/kubernetes/include/apiClient.h @@ -19,9 +19,20 @@ typedef struct sslConfig_t { /* 1 -- skip ssl verify for server certificate */ } sslConfig_t; +typedef struct curlConfig_t { + long verbose; /* 0 -- disable verbose (default) */ + /* 1 -- enable verbose */ + int keepalive; /* 0 -- disable keepalive (default) */ + /* 1 -- enable keepalive */ + long keepidle; /* keep-alive idle time: default to 120 seconds */ + long keepintvl; /* interval time between keep-alive probes: default to 60 seconds */ +} curlConfig_t; + typedef struct apiClient_t { char *basePath; sslConfig_t *sslConfig; + curlConfig_t *curlConfig; + void (*curl_pre_invoke_func)(CURL *); void *dataReceived; long dataReceivedLen; void (*data_callback_func)(void **, long *); diff --git a/kubernetes/src/apiClient.c b/kubernetes/src/apiClient.c index 92a4b6a..8c54e35 100644 --- a/kubernetes/src/apiClient.c +++ b/kubernetes/src/apiClient.c @@ -10,6 +10,8 @@ apiClient_t *apiClient_create() { apiClient_t *apiClient = malloc(sizeof(apiClient_t)); apiClient->basePath = strdup("http://localhost"); apiClient->sslConfig = NULL; + apiClient->curlConfig = NULL; + apiClient->curl_pre_invoke_func = NULL; apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; apiClient->data_callback_func = NULL; @@ -38,6 +40,13 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath apiClient->sslConfig = NULL; } + apiClient->curlConfig = malloc(sizeof(curlConfig_t)); + apiClient->curlConfig->verbose = 0; + apiClient->curlConfig->keepalive = 0; + apiClient->curlConfig->keepidle = 120; + apiClient->curlConfig->keepintvl = 60; + + apiClient->curl_pre_invoke_func = NULL; apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; apiClient->data_callback_func = NULL; @@ -80,6 +89,14 @@ void apiClient_free(apiClient_t *apiClient) { } list_freeList(apiClient->apiKeys_BearerToken); } + + if(apiClient->curlConfig) { + free(apiClient->curlConfig); + apiClient->curlConfig = NULL; + } + + apiClient->curl_pre_invoke_func = NULL; + free(apiClient); } @@ -416,13 +433,25 @@ void apiClient_invoke(apiClient_t *apiClient, CURLOPT_WRITEDATA, apiClient); curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable if(bodyParameters != NULL) { postData(handle, bodyParameters, bodyParametersLength); } + if(apiClient->curlConfig != NULL) { + if(apiClient->curlConfig->keepalive == 1) { + curl_easy_setopt(handle, CURLOPT_TCP_KEEPALIVE, 1L); + curl_easy_setopt(handle, CURLOPT_TCP_KEEPIDLE, apiClient->curlConfig->keepidle); + curl_easy_setopt(handle, CURLOPT_TCP_KEEPINTVL, apiClient->curlConfig->keepintvl); + } + curl_easy_setopt(handle, CURLOPT_VERBOSE, apiClient->curlConfig->verbose); + } + + if(apiClient->curl_pre_invoke_func) { + apiClient->curl_pre_invoke_func(handle); + } + res = curl_easy_perform(handle); curl_slist_free_all(headers); diff --git a/settings b/settings index 78a4f69..030bd5f 100644 --- a/settings +++ b/settings @@ -2,12 +2,12 @@ export KUBERNETES_BRANCH="release-1.33" # client version is not currently used by the code generator. -export CLIENT_VERSION="0.13.0" +export CLIENT_VERSION="0.13.1" # Name of the release package export PACKAGE_NAME="client" # OpenAPI-Generator branch/tag to generate the client library -export OPENAPI_GENERATOR_COMMIT="master" +export OPENAPI_GENERATOR_COMMIT="HEAD" export USERNAME=kubernetes