Skip to content

Commit 84ca277

Browse files
committed
Update create/free list function names due to changes in generated code
1 parent 4c6db23 commit 84ca277

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

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/config/authn_plugin/plugins/oidc/libkubernetes_oidc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static int refresh_oidc_token(kubeconfig_property_t * auth_provider, const char
173173
return -1;
174174
}
175175

176-
list_t *content_type = list_create();
176+
list_t *content_type = list_createList();
177177
if (!content_type) {
178178
fprintf(stderr, "%s: Cannot create list for content type.[%s]\n", fname, strerror(errno));
179179
return -1;
@@ -193,7 +193,7 @@ static int refresh_oidc_token(kubeconfig_property_t * auth_provider, const char
193193
memset(basic_token_buffer, 0, sizeof(basic_token_buffer));
194194
snprintf(basic_token_buffer, sizeof(basic_token_buffer), BASIC_TOKEN_TEMPLATE, base64_credential);
195195

196-
list_t *api_keys = list_create();
196+
list_t *api_keys = list_createList();
197197
if (!api_keys) {
198198
fprintf(stderr, "%s: Cannot create list for refresh token.[%s]\n", fname, strerror(errno));
199199
rc = -1;

kubernetes/config/incluster_config.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static int setApiKeysInCluster(list_t ** pApiKeys)
128128
{
129129
static char fname[] = "setApiKeysInCluster()";
130130

131-
list_t *apiKeys = list_create();
131+
list_t *apiKeys = list_createList();
132132
if (!apiKeys) {
133133
fprintf(stderr, "%s: Cannot allocate the memory for api kyes for kubernetes service.\n", fname);
134134
return -1;

kubernetes/config/kube_config.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int setApiKeys(list_t ** pApiKeys, const char *token)
8585
{
8686
static char fname[] = "setApiKeys()";
8787

88-
list_t *apiKeys = list_create();
88+
list_t *apiKeys = list_createList();
8989
if (!apiKeys) {
9090
fprintf(stderr, "%s: Cannot allocate the memory for api key list for kubernetes service.\n", fname);
9191
return -1;

kubernetes/config/kube_config_util.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ void clear_and_free_string_pair_list(list_t * list)
128128
keyValuePair_free(pair);
129129
pair = NULL;
130130
}
131-
list_free(list);
131+
list_freeList(list);
132132
}

kubernetes/watch/watch_util.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void kubernets_watch_handler(void **pData, long *pDataLen, KUBE_WATCH_EVENT_HAND
4242
{
4343
char *data = *(char **) pData;
4444

45-
list_t *watch_event_list = list_create();
45+
list_t *watch_event_list = list_createList();
4646
if (!watch_event_list) {
4747
fprintf(stderr, "Cannot create a list for watch events.\n");
4848
return;

0 commit comments

Comments
 (0)