mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-08-19 12:26:06 +00:00
cleanup: remove restart policy type
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
+2
-2
@@ -722,8 +722,8 @@ static int hyper_release_exec(struct hyper_exec *exec,
|
||||
|
||||
fprintf(stdout, "%s exit code %" PRIu8"\n", __func__, exec->code);
|
||||
if (exec->init) {
|
||||
fprintf(stdout, "%s container init exited, type %d, remains %d, policy %d\n",
|
||||
__func__, pod->type, pod->remains, pod->policy);
|
||||
fprintf(stdout, "%s container init exited, type %d, remains %d\n",
|
||||
__func__, pod->type, pod->remains);
|
||||
|
||||
// TODO send finish of this container and full cleanup
|
||||
if (--pod->remains > 0)
|
||||
|
||||
@@ -18,12 +18,6 @@
|
||||
/* Path to rootfs shared directory */
|
||||
#define SHARED_DIR "/tmp/hyper/shared"
|
||||
|
||||
enum {
|
||||
POLICY_NEVER,
|
||||
POLICY_ALWAYS,
|
||||
POLICY_ONFAILURE,
|
||||
};
|
||||
|
||||
struct hyper_pod {
|
||||
struct hyper_interface *iface;
|
||||
struct hyper_route *rt;
|
||||
@@ -40,7 +34,6 @@ struct hyper_pod {
|
||||
uint32_t type;
|
||||
/* how many containers are running */
|
||||
uint32_t remains;
|
||||
uint8_t policy;
|
||||
int efd;
|
||||
};
|
||||
|
||||
|
||||
+2
-9
@@ -1146,8 +1146,6 @@ realloc:
|
||||
goto out;
|
||||
}
|
||||
|
||||
pod->policy = POLICY_NEVER;
|
||||
|
||||
fprintf(stdout, "jsmn parse successed, n is %d\n", n);
|
||||
next = 0;
|
||||
for (i = 0; i < n;) {
|
||||
@@ -1193,13 +1191,8 @@ realloc:
|
||||
fprintf(stdout, "hostname is %s\n", pod->hostname);
|
||||
i++;
|
||||
} else if (json_token_streq(json, t, "restartPolicy") && t->size == 1) {
|
||||
i++;
|
||||
if (json_token_streq(json, &toks[i], "always") && toks[i].size == 1)
|
||||
pod->policy = POLICY_ALWAYS;
|
||||
else if (json_token_streq(json, &toks[i], "onFailure") && toks[i].size == 1)
|
||||
pod->policy = POLICY_ONFAILURE;
|
||||
fprintf(stdout, "restartPolicy is %" PRIu8 "\n", pod->policy);
|
||||
i++;
|
||||
i += 2;
|
||||
fprintf(stdout, "restartPolicy is deprecated\n");
|
||||
} else if (json_token_streq(json, t, "portmappingWhiteLists") && t->size == 1) {
|
||||
next = hyper_parse_portmapping_whitelist(pod, json, &toks[++i]);
|
||||
if (next < 0)
|
||||
|
||||
Reference in New Issue
Block a user