Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing derives to container opts #166

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/opts/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use containers_api::{
impl_str_field, impl_url_bool_field, impl_url_field, impl_url_str_field, impl_url_vec_field,
impl_vec_field,
};
use serde::{Deserialize, Serialize};
use std::fmt;

impl_opts_builder!(url =>
Expand Down Expand Up @@ -288,7 +289,7 @@ impl_opts_builder!(json =>
ContainerCreate
);

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
/// Mode used to configure image volume with
/// [`image_volume_mode`](ContainerCreateOptsBuilder::image_volume_mode).
#[derive(Default)]
Expand Down Expand Up @@ -318,11 +319,13 @@ impl fmt::Display for ImageVolumeMode {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
/// How to handle the `NOTIFY_SOCKET`. Used with
/// [`sdnotify_mode`](ContainerCreateOptsBuilder::sdnotify_mode).
#[derive(Default)]
pub enum SocketNotifyMode {
/// Let the OCI runtime deal with it, advertise conmon's MAINPID.
#[default]
Container,
/// Advertise conmon's MAINPID, send READY when started, don't pass to OCI.
Conmon,
Expand All @@ -346,7 +349,7 @@ impl fmt::Display for SocketNotifyMode {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
/// Used with [`ContainerCreateOptsBuilder::seccomp_policy`](ContainerCreateOptsBuilder::seccomp_policy).
#[derive(Default)]
pub enum SeccompPolicy {
Expand All @@ -372,7 +375,7 @@ impl fmt::Display for SeccompPolicy {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
/// Used with [`ContainerCreateOptsBuilder::systemd`](ContainerCreateOptsBuilder::systemd).
#[derive(Default)]
pub enum SystemdEnabled {
Expand All @@ -398,7 +401,7 @@ impl fmt::Display for SystemdEnabled {
}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
/// Used with
/// [`ContainerCreateOptsBuilder::restart_policy`](ContainerCreateOptsBuilder::restart_policy).
#[derive(Default)]
Expand Down
Loading