2020-03-18 17:24:33 +08:00
|
|
|
/*
|
|
|
|
|
* v1_container.h
|
|
|
|
|
*
|
|
|
|
|
* A single application container that you want to run within a pod.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _v1_container_H_
|
|
|
|
|
#define _v1_container_H_
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "../external/cJSON.h"
|
|
|
|
|
#include "../include/list.h"
|
|
|
|
|
#include "../include/keyValuePair.h"
|
2020-06-20 09:41:15 +08:00
|
|
|
#include "../include/binary.h"
|
|
|
|
|
|
|
|
|
|
typedef struct v1_container_t v1_container_t;
|
|
|
|
|
|
2020-03-18 17:24:33 +08:00
|
|
|
#include "v1_container_port.h"
|
2023-06-05 02:09:22 +00:00
|
|
|
#include "v1_container_resize_policy.h"
|
2020-03-18 17:24:33 +08:00
|
|
|
#include "v1_env_from_source.h"
|
|
|
|
|
#include "v1_env_var.h"
|
|
|
|
|
#include "v1_lifecycle.h"
|
|
|
|
|
#include "v1_probe.h"
|
|
|
|
|
#include "v1_resource_requirements.h"
|
|
|
|
|
#include "v1_security_context.h"
|
|
|
|
|
#include "v1_volume_device.h"
|
|
|
|
|
#include "v1_volume_mount.h"
|
|
|
|
|
|
2021-09-05 12:12:19 -03:00
|
|
|
|
2020-03-18 17:24:33 +08:00
|
|
|
|
|
|
|
|
typedef struct v1_container_t {
|
|
|
|
|
list_t *args; //primitive container
|
|
|
|
|
list_t *command; //primitive container
|
|
|
|
|
list_t *env; //nonprimitive container
|
|
|
|
|
list_t *env_from; //nonprimitive container
|
|
|
|
|
char *image; // string
|
2022-06-05 18:16:17 +00:00
|
|
|
char *image_pull_policy; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
struct v1_lifecycle_t *lifecycle; //model
|
|
|
|
|
struct v1_probe_t *liveness_probe; //model
|
|
|
|
|
char *name; // string
|
|
|
|
|
list_t *ports; //nonprimitive container
|
|
|
|
|
struct v1_probe_t *readiness_probe; //model
|
2023-06-05 02:09:22 +00:00
|
|
|
list_t *resize_policy; //nonprimitive container
|
2020-03-18 17:24:33 +08:00
|
|
|
struct v1_resource_requirements_t *resources; //model
|
2023-09-06 01:56:31 +00:00
|
|
|
char *restart_policy; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
struct v1_security_context_t *security_context; //model
|
|
|
|
|
struct v1_probe_t *startup_probe; //model
|
2021-09-07 04:36:00 -03:00
|
|
|
int _stdin; //boolean
|
2020-03-18 17:24:33 +08:00
|
|
|
int stdin_once; //boolean
|
|
|
|
|
char *termination_message_path; // string
|
2022-06-05 18:16:17 +00:00
|
|
|
char *termination_message_policy; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
int tty; //boolean
|
|
|
|
|
list_t *volume_devices; //nonprimitive container
|
|
|
|
|
list_t *volume_mounts; //nonprimitive container
|
|
|
|
|
char *working_dir; // string
|
|
|
|
|
|
|
|
|
|
} v1_container_t;
|
|
|
|
|
|
|
|
|
|
v1_container_t *v1_container_create(
|
|
|
|
|
list_t *args,
|
|
|
|
|
list_t *command,
|
|
|
|
|
list_t *env,
|
|
|
|
|
list_t *env_from,
|
|
|
|
|
char *image,
|
2022-06-05 18:16:17 +00:00
|
|
|
char *image_pull_policy,
|
2020-03-18 17:24:33 +08:00
|
|
|
v1_lifecycle_t *lifecycle,
|
|
|
|
|
v1_probe_t *liveness_probe,
|
|
|
|
|
char *name,
|
|
|
|
|
list_t *ports,
|
|
|
|
|
v1_probe_t *readiness_probe,
|
2023-06-05 02:09:22 +00:00
|
|
|
list_t *resize_policy,
|
2020-03-18 17:24:33 +08:00
|
|
|
v1_resource_requirements_t *resources,
|
2023-09-06 01:56:31 +00:00
|
|
|
char *restart_policy,
|
2020-03-18 17:24:33 +08:00
|
|
|
v1_security_context_t *security_context,
|
|
|
|
|
v1_probe_t *startup_probe,
|
2021-09-07 04:36:00 -03:00
|
|
|
int _stdin,
|
2020-03-18 17:24:33 +08:00
|
|
|
int stdin_once,
|
|
|
|
|
char *termination_message_path,
|
2022-06-05 18:16:17 +00:00
|
|
|
char *termination_message_policy,
|
2020-03-18 17:24:33 +08:00
|
|
|
int tty,
|
|
|
|
|
list_t *volume_devices,
|
|
|
|
|
list_t *volume_mounts,
|
|
|
|
|
char *working_dir
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
void v1_container_free(v1_container_t *v1_container);
|
|
|
|
|
|
|
|
|
|
v1_container_t *v1_container_parseFromJSON(cJSON *v1_containerJSON);
|
|
|
|
|
|
|
|
|
|
cJSON *v1_container_convertToJSON(v1_container_t *v1_container);
|
|
|
|
|
|
|
|
|
|
#endif /* _v1_container_H_ */
|
|
|
|
|
|