feat(frontend): add `deploy` attribute to `IEditServiceForm` interface

* Updatd `IService` to make all the attributes in `deploy` optional.
   This change ensures that `IService.deploy` adheres to the specification.
pull/85/head
Samuel Rowe 3 years ago
parent 0d76bed1c9
commit a65d00c7f8

@ -153,48 +153,48 @@ export interface IService {
condition: string; condition: string;
}; };
}; };
deploy: { deploy?: {
endpoint_mode: string; endpoint_mode?: "vip" | "dnsrr";
labels: string[] | { [key: string]: string }; labels?: string[] | Record<string, string>;
mode: string; mode?: "replicated" | "global";
placement: { placement?: {
constraints: KeyValPair[] | KeyValPair; constraints?: KeyValPair[] | KeyValPair;
preferences: KeyValPair[] | KeyValPair; preferences?: KeyValPair[] | KeyValPair;
}; };
replicas: number; replicas?: number;
resources: { resources?: {
limits: { limits?: {
cpus: string; cpus?: string;
memory: string; memory?: string;
pids: number; pids?: number;
}; };
reservations: { reservations?: {
cpus: string; cpus?: string;
memory: string; memory?: string;
devices: { [key: string]: string | number | string[] }[]; devices?: { [key: string]: string | number | string[] }[];
}; };
}; };
restart_policy: { restart_policy?: {
condition: string; condition?: "none" | "on-failure" | "any";
delay: string; delay?: string;
max_attempts: number; max_attempts?: number;
window: string; window?: string;
}; };
rollback_config: { rollback_config?: {
parallelism: number; parallelism?: number;
delay: string; delay?: string;
failure_action: string; failure_action?: string;
monitor: string; monitor?: string;
max_failure_ratio: string; max_failure_ratio?: string;
order: string; order?: string;
}; };
update_config: { update_config?: {
parallelism: number; parallelism?: number;
delay: string; delay?: string;
failure_action: string; failure_action?: string;
monitor: string; monitor?: string;
max_failure_ratio: string; max_failure_ratio?: string;
order: string; order?: string;
}; };
}; };
device_cgroup_rules: string[]; device_cgroup_rules: string[];
@ -385,6 +385,55 @@ export interface IEditServiceForm {
sharedMemorySize: string; sharedMemorySize: string;
target: string; target: string;
}; };
deploy: {
/**
* The default value for `mode` is `replicated`. However, we allow
* it to be empty. Thus, `mode` attribute can be pruned away
* if the user never assigned `mode` explicitly.
*/
mode: "" | "global" | "replicated";
/**
* The default value for `endpointMode` is platform dependent.
*/
endpointMode: "" | "vip" | "dnsrr";
replicas: string;
placement: {
constraints: {
key: string;
value: string;
}[];
preferences: {
key: string;
value: string;
}[];
};
resources: {
limits: {
cpus: string;
memory: string;
pids: string;
};
reservations: {
cpus: string;
memory: string;
};
};
restartPolicy: {
/**
* The default value for `condition` is `any`. However, we allow
* it to be empty. Thus, `deploy` attribute can be pruned away
* if the user never assigned `condition` explicitly.
*/
condition: "" | "none" | "on-failure" | "any";
delay: string;
maxAttempts: string;
window: string;
};
labels: {
key: string;
value: string;
}[];
};
serviceName: string; serviceName: string;
imageName: string; imageName: string;
imageTag: string; imageTag: string;

Loading…
Cancel
Save