Skip to content

Commit 5bf6cd5

Browse files
authored
Merge pull request #109 from ityuhui/yh-merge-upstream-0309
Merge the recent changes from openapi-generator
2 parents 94d85b5 + 2942dfc commit 5bf6cd5

File tree

1,382 files changed

+4578
-149774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,382 files changed

+4578
-149774
lines changed

.github/workflows/code-check.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- name: Prepare
15-
run: sudo apt-get install -y cppcheck
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install -y cppcheck
1618
- name: Code static check for config
1719
run: sh ./code-check/code-static-check.sh ./kubernetes/config/
1820
- name: Code static check for examples
@@ -22,7 +24,9 @@ jobs:
2224
steps:
2325
- uses: actions/checkout@v2
2426
- name: Prepare
25-
run: sudo apt-get install -y indent
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y indent
2630
- name: Code style check for config
2731
run: |
2832
find ./kubernetes/config/ -type f -regextype posix-extended -regex ".*\.(c|h)" -exec sh ./code-check/code-style-check.sh {} \;

examples/configmap/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void create_configmap(apiClient_t * apiClient, char *name, char *namespace_)
1111
char *api_version = strdup("v1");
1212
char *kind = strdup("ConfigMap");
1313

14-
list_t *data = list_create();
14+
list_t *data = list_createList();
1515
keyValuePair_t *kv = keyValuePair_create(strdup("worker1"), strdup("1"));
1616
list_addElement(data, kv);
1717
kv = keyValuePair_create(strdup("worker2"), strdup("2"));

examples/create_pod/main.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ void create_a_pod(apiClient_t * apiClient)
1919
podinfo->metadata->name = strdup("test-pod-6");
2020

2121
/* set containers for pod */
22-
list_t *containerlist = list_create();
22+
list_t *containerlist = list_createList();
2323
v1_container_t *con = calloc(1, sizeof(v1_container_t));
2424
con->name = strdup("my-container");
2525
con->image = strdup("ubuntu:latest");
2626
con->image_pull_policy = strdup("IfNotPresent");
2727

2828
/* set command for container */
29-
list_t *commandlist = list_create();
29+
list_t *commandlist = list_createList();
3030
char *cmd = strdup("sleep");
3131
list_addElement(commandlist, cmd);
3232
con->command = commandlist;
3333

34-
list_t *arglist = list_create();
34+
list_t *arglist = list_createList();
3535
char *arg1 = strdup("3600");
3636
list_addElement(arglist, arg1);
3737
con->args = arglist;
3838

3939
/* set volume mounts for container */
40-
list_t *volumemounts = list_create();
40+
list_t *volumemounts = list_createList();
4141
v1_volume_mount_t *volmou = calloc(1, sizeof(v1_volume_mount_t));
4242
volmou->mount_path = strdup("/test");
4343
volmou->name = strdup("test");
@@ -48,7 +48,7 @@ void create_a_pod(apiClient_t * apiClient)
4848
podinfo->spec->containers = containerlist;
4949

5050
/* set volumes for pod */
51-
list_t *volumelist = list_create();
51+
list_t *volumelist = list_createList();
5252
v1_volume_t *volume = calloc(1, sizeof(v1_volume_t));
5353
volume->name = strdup("test");
5454

examples/generic/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ int main(int argc, char *argv[])
4747
free(update);
4848

4949
const char *patchBody = "[{\"op\": \"replace\", \"path\": \"/metadata/labels/foo\", \"value\": \"qux\" }]";
50-
list_t *contentType = list_create();
50+
list_t *contentType = list_createList();
5151
// Kubernetes supports multiple content types:
5252
list_addElement(contentType, "application/json-patch+json");
5353
// list_addElement(contentType, "application/merge-patch+json");
5454
// list_addElement(contentType, "application/strategic-merge-patch+json");
5555
// list_addElement(contentType, "application/apply-patch+yaml");
5656
char *patch = Generic_patchResource(genericClient, "test", patchBody, NULL, NULL, NULL, NULL, contentType);
5757
printf("%s\n", patch);
58-
list_free(contentType);
58+
list_freeList(contentType);
5959
free(patch);
6060

6161
char *del = Generic_deleteResource(genericClient, "test");

examples/multi_thread/create_pod.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ static void create_a_pod(apiClient_t * apiClient)
1414
podinfo->metadata->name = strdup("test-pod-8");
1515

1616
/* set containers for pod */
17-
list_t *containerlist = list_create();
17+
list_t *containerlist = list_createList();
1818
v1_container_t *con = calloc(1, sizeof(v1_container_t));
1919
con->name = strdup("my-container");
2020
con->image = strdup("ubuntu:latest");
2121
con->image_pull_policy = strdup("IfNotPresent");
2222

2323
/* set command for container */
24-
list_t *commandlist = list_create();
24+
list_t *commandlist = list_createList();
2525
char *cmd = strdup("sleep");
2626
list_addElement(commandlist, cmd);
2727
con->command = commandlist;
2828

29-
list_t *arglist = list_create();
29+
list_t *arglist = list_createList();
3030
char *arg1 = strdup("3600");
3131
list_addElement(arglist, arg1);
3232
con->args = arglist;
3333

3434
/* set volume mounts for container */
35-
list_t *volumemounts = list_create();
35+
list_t *volumemounts = list_createList();
3636
v1_volume_mount_t *volmou = calloc(1, sizeof(v1_volume_mount_t));
3737
volmou->mount_path = strdup("/test");
3838
volmou->name = strdup("test");
@@ -43,7 +43,7 @@ static void create_a_pod(apiClient_t * apiClient)
4343
podinfo->spec->containers = containerlist;
4444

4545
/* set volumes for pod */
46-
list_t *volumelist = list_create();
46+
list_t *volumelist = list_createList();
4747
v1_volume_t *volume = calloc(1, sizeof(v1_volume_t));
4848
volume->name = strdup("test");
4949

kubernetes/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.6...3.10.2)
22
project (CGenerator)
33

44
cmake_policy(SET CMP0063 NEW)
5+
56
set(CMAKE_C_VISIBILITY_PRESET default)
67
set(CMAKE_CXX_VISIBILITY_PRESET default)
78
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)

kubernetes/api/AdmissionregistrationAPI.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AdmissionregistrationAPI_getAPIGroup(apiClient_t *apiClient)
2020
list_t *localVarQueryParameters = NULL;
2121
list_t *localVarHeaderParameters = NULL;
2222
list_t *localVarFormParameters = NULL;
23-
list_t *localVarHeaderType = list_create();
23+
list_t *localVarHeaderType = list_createList();
2424
list_t *localVarContentType = NULL;
2525
char *localVarBodyParameters = NULL;
2626

@@ -67,7 +67,7 @@ AdmissionregistrationAPI_getAPIGroup(apiClient_t *apiClient)
6767

6868

6969

70-
list_free(localVarHeaderType);
70+
list_freeList(localVarHeaderType);
7171

7272
free(localVarPath);
7373
return elementToReturn;

0 commit comments

Comments
 (0)