Merge pull request #280 from brendandburns/automated-generate-67769f3a

Update to get latest code generator fixes
This commit is contained in:
Kubernetes Prow Robot
2025-08-01 08:09:38 -07:00
committed by GitHub
8 changed files with 58 additions and 14 deletions

View File

@@ -1,2 +1,2 @@
Requested Commit/Tag : master Requested Commit/Tag : HEAD
Actual Commit : 4402d836bb85f95c2d634844fdffde90bb5dd186 Actual Commit : fcc83db0f8f3e9ba8bf58219ef9c75b177587521

View File

@@ -1 +1 @@
7.14.0-SNAPSHOT 7.15.0-SNAPSHOT

View File

@@ -1583,7 +1583,11 @@ include(PreTarget.cmake OPTIONAL)
set(PROJECT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 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 with project file with project name as library name
if(NOT BUILD_STATIC_LIBS)
add_library(${pkgName} ${SRCS} ${HDRS}) add_library(${pkgName} ${SRCS} ${HDRS})
else()
add_library(${pkgName} STATIC ${SRCS} ${HDRS})
endif()
# Link dependent libraries # Link dependent libraries
if(NOT CMAKE_VERSION VERSION_LESS 3.4) if(NOT CMAKE_VERSION VERSION_LESS 3.4)
target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(${pkgName} PRIVATE OpenSSL::SSL OpenSSL::Crypto)

View File

@@ -1,6 +1,6 @@
set(PROJECT_VERSION_MAJOR 0) set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 13) 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_DESCRIPTION_SUMMARY "The Kubernetes client library for the C programming language.")
set(PROJECT_PACKAGE_VENDOR "https://github.com/kubernetes-client") set(PROJECT_PACKAGE_VENDOR "https://github.com/kubernetes-client")

View File

@@ -5,20 +5,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
- API version: release-1.33 - API version: release-1.33
- Package version: - Package version:
- Generator version: 7.14.0-SNAPSHOT - Generator version: 7.15.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen - Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen
## Installation ## 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 # 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 ```bash
sudo apt remove curl sudo apt remove curl
wget http://curl.haxx.se/download/curl-7.58.0.tar.gz wget http://curl.haxx.se/download/curl-7.61.1.tar.gz
tar -xvf curl-7.58.0.tar.gz tar -xvf curl-7.61.1.tar.gz
cd curl-7.58.0/ cd curl-7.61.1/
./configure ./configure
make make
sudo make install sudo make install

View File

@@ -19,9 +19,20 @@ typedef struct sslConfig_t {
/* 1 -- skip ssl verify for server certificate */ /* 1 -- skip ssl verify for server certificate */
} sslConfig_t; } 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 { typedef struct apiClient_t {
char *basePath; char *basePath;
sslConfig_t *sslConfig; sslConfig_t *sslConfig;
curlConfig_t *curlConfig;
void (*curl_pre_invoke_func)(CURL *);
void *dataReceived; void *dataReceived;
long dataReceivedLen; long dataReceivedLen;
void (*data_callback_func)(void **, long *); void (*data_callback_func)(void **, long *);

View File

@@ -10,6 +10,8 @@ apiClient_t *apiClient_create() {
apiClient_t *apiClient = malloc(sizeof(apiClient_t)); apiClient_t *apiClient = malloc(sizeof(apiClient_t));
apiClient->basePath = strdup("http://localhost"); apiClient->basePath = strdup("http://localhost");
apiClient->sslConfig = NULL; apiClient->sslConfig = NULL;
apiClient->curlConfig = NULL;
apiClient->curl_pre_invoke_func = NULL;
apiClient->dataReceived = NULL; apiClient->dataReceived = NULL;
apiClient->dataReceivedLen = 0; apiClient->dataReceivedLen = 0;
apiClient->data_callback_func = NULL; apiClient->data_callback_func = NULL;
@@ -38,6 +40,13 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath
apiClient->sslConfig = NULL; 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->dataReceived = NULL;
apiClient->dataReceivedLen = 0; apiClient->dataReceivedLen = 0;
apiClient->data_callback_func = NULL; apiClient->data_callback_func = NULL;
@@ -80,6 +89,14 @@ void apiClient_free(apiClient_t *apiClient) {
} }
list_freeList(apiClient->apiKeys_BearerToken); list_freeList(apiClient->apiKeys_BearerToken);
} }
if(apiClient->curlConfig) {
free(apiClient->curlConfig);
apiClient->curlConfig = NULL;
}
apiClient->curl_pre_invoke_func = NULL;
free(apiClient); free(apiClient);
} }
@@ -416,13 +433,25 @@ void apiClient_invoke(apiClient_t *apiClient,
CURLOPT_WRITEDATA, CURLOPT_WRITEDATA,
apiClient); apiClient);
curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); 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) { if(bodyParameters != NULL) {
postData(handle, bodyParameters, bodyParametersLength); 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); res = curl_easy_perform(handle);
curl_slist_free_all(headers); curl_slist_free_all(headers);

View File

@@ -2,12 +2,12 @@
export KUBERNETES_BRANCH="release-1.33" export KUBERNETES_BRANCH="release-1.33"
# client version is not currently used by the code generator. # 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 # Name of the release package
export PACKAGE_NAME="client" export PACKAGE_NAME="client"
# OpenAPI-Generator branch/tag to generate the client library # OpenAPI-Generator branch/tag to generate the client library
export OPENAPI_GENERATOR_COMMIT="master" export OPENAPI_GENERATOR_COMMIT="HEAD"
export USERNAME=kubernetes export USERNAME=kubernetes