Update create/free list function names due to changes in generated code
This commit is contained in:
@@ -11,7 +11,7 @@ void create_configmap(apiClient_t * apiClient, char *name, char *namespace_)
|
||||
char *api_version = strdup("v1");
|
||||
char *kind = strdup("ConfigMap");
|
||||
|
||||
list_t *data = list_create();
|
||||
list_t *data = list_createList();
|
||||
keyValuePair_t *kv = keyValuePair_create(strdup("worker1"), strdup("1"));
|
||||
list_addElement(data, kv);
|
||||
kv = keyValuePair_create(strdup("worker2"), strdup("2"));
|
||||
|
||||
@@ -19,25 +19,25 @@ void create_a_pod(apiClient_t * apiClient)
|
||||
podinfo->metadata->name = strdup("test-pod-6");
|
||||
|
||||
/* set containers for pod */
|
||||
list_t *containerlist = list_create();
|
||||
list_t *containerlist = list_createList();
|
||||
v1_container_t *con = calloc(1, sizeof(v1_container_t));
|
||||
con->name = strdup("my-container");
|
||||
con->image = strdup("ubuntu:latest");
|
||||
con->image_pull_policy = strdup("IfNotPresent");
|
||||
|
||||
/* set command for container */
|
||||
list_t *commandlist = list_create();
|
||||
list_t *commandlist = list_createList();
|
||||
char *cmd = strdup("sleep");
|
||||
list_addElement(commandlist, cmd);
|
||||
con->command = commandlist;
|
||||
|
||||
list_t *arglist = list_create();
|
||||
list_t *arglist = list_createList();
|
||||
char *arg1 = strdup("3600");
|
||||
list_addElement(arglist, arg1);
|
||||
con->args = arglist;
|
||||
|
||||
/* set volume mounts for container */
|
||||
list_t *volumemounts = list_create();
|
||||
list_t *volumemounts = list_createList();
|
||||
v1_volume_mount_t *volmou = calloc(1, sizeof(v1_volume_mount_t));
|
||||
volmou->mount_path = strdup("/test");
|
||||
volmou->name = strdup("test");
|
||||
@@ -48,7 +48,7 @@ void create_a_pod(apiClient_t * apiClient)
|
||||
podinfo->spec->containers = containerlist;
|
||||
|
||||
/* set volumes for pod */
|
||||
list_t *volumelist = list_create();
|
||||
list_t *volumelist = list_createList();
|
||||
v1_volume_t *volume = calloc(1, sizeof(v1_volume_t));
|
||||
volume->name = strdup("test");
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
|
||||
free(update);
|
||||
|
||||
const char *patchBody = "[{\"op\": \"replace\", \"path\": \"/metadata/labels/foo\", \"value\": \"qux\" }]";
|
||||
list_t *contentType = list_create();
|
||||
list_t *contentType = list_createList();
|
||||
// Kubernetes supports multiple content types:
|
||||
list_addElement(contentType, "application/json-patch+json");
|
||||
// list_addElement(contentType, "application/merge-patch+json");
|
||||
@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
|
||||
// list_addElement(contentType, "application/apply-patch+yaml");
|
||||
char *patch = Generic_patchResource(genericClient, "test", patchBody, NULL, NULL, NULL, NULL, contentType);
|
||||
printf("%s\n", patch);
|
||||
list_free(contentType);
|
||||
list_freeList(contentType);
|
||||
free(patch);
|
||||
|
||||
char *del = Generic_deleteResource(genericClient, "test");
|
||||
|
||||
@@ -14,25 +14,25 @@ static void create_a_pod(apiClient_t * apiClient)
|
||||
podinfo->metadata->name = strdup("test-pod-8");
|
||||
|
||||
/* set containers for pod */
|
||||
list_t *containerlist = list_create();
|
||||
list_t *containerlist = list_createList();
|
||||
v1_container_t *con = calloc(1, sizeof(v1_container_t));
|
||||
con->name = strdup("my-container");
|
||||
con->image = strdup("ubuntu:latest");
|
||||
con->image_pull_policy = strdup("IfNotPresent");
|
||||
|
||||
/* set command for container */
|
||||
list_t *commandlist = list_create();
|
||||
list_t *commandlist = list_createList();
|
||||
char *cmd = strdup("sleep");
|
||||
list_addElement(commandlist, cmd);
|
||||
con->command = commandlist;
|
||||
|
||||
list_t *arglist = list_create();
|
||||
list_t *arglist = list_createList();
|
||||
char *arg1 = strdup("3600");
|
||||
list_addElement(arglist, arg1);
|
||||
con->args = arglist;
|
||||
|
||||
/* set volume mounts for container */
|
||||
list_t *volumemounts = list_create();
|
||||
list_t *volumemounts = list_createList();
|
||||
v1_volume_mount_t *volmou = calloc(1, sizeof(v1_volume_mount_t));
|
||||
volmou->mount_path = strdup("/test");
|
||||
volmou->name = strdup("test");
|
||||
@@ -43,7 +43,7 @@ static void create_a_pod(apiClient_t * apiClient)
|
||||
podinfo->spec->containers = containerlist;
|
||||
|
||||
/* set volumes for pod */
|
||||
list_t *volumelist = list_create();
|
||||
list_t *volumelist = list_createList();
|
||||
v1_volume_t *volume = calloc(1, sizeof(v1_volume_t));
|
||||
volume->name = strdup("test");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user