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

fix: missing attributes for create container request added #127

Merged
merged 1 commit into from
Jul 28, 2022
Merged
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
72 changes: 59 additions & 13 deletions src/opts/containers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,15 @@ impl ContainerCreateOptsBuilder {
dependency_containers => "dependencyContainers"
);

//TODO: device_cgroup_rule
impl_vec_field!(
/// DeviceCgroupRule are device cgroup rules that allow containers to use additional types of devices.
device_cgroup_rule : models::LinuxDeviceCgroup => "device_cgroup_rule"
);

//TODO: devices
impl_vec_field!(
/// Devices are devices that will be added to the container.
devices : models::LinuxDevice => "devices"
);

impl_vec_field!(
/// A way to ensure your container inherits device specific information from another container.
Expand Down Expand Up @@ -487,7 +493,11 @@ impl ContainerCreateOptsBuilder {
health_config: models::Schema2HealthConfig => "healthconfig"
);

// TODO: host_device_list
impl_vec_field!(
/// The bits have the same definition on all systems, so that information about files can be moved from one system to another portably.
/// Not all bits apply to all systems. The only required bit is ModeDir for directories.
host_device_list : models::LinuxDevice => "host_device_list"
);

impl_vec_field!(
/// A set of hosts which will be added to the container's etc/hosts file. Conflicts with
Expand Down Expand Up @@ -528,7 +538,10 @@ impl ContainerCreateOptsBuilder {
image_volume_mode: ImageVolumeMode => "image_volume_mode"
);

// TODO: image_volumes
impl_vec_field!(
/// Image volumes bind-mount a container-image mount into the container.
image_volumes : models::ImageVolume => "image_volumes"
);

impl_field!(
/// Specifies that an init binary will be mounted into the container, and will be used as
Expand Down Expand Up @@ -591,7 +604,13 @@ impl ContainerCreateOptsBuilder {
network_options => "network_options"
);

// TODO: networks
impl_map_field!(json
/// Map of networks names or ids that the container should join.
/// You can request additional settings for each network, you can set network aliases,
/// static ips, static mac address and the network interface name for this container on the specific network.
/// If the map is empty and the bridge network mode is set the container will be joined to the default network.
networks => "Networks"
);

impl_field!(
/// Whether the container will set the no new privileges flag on create, which disables
Expand All @@ -610,7 +629,10 @@ impl ContainerCreateOptsBuilder {
oom_score_adj: i64 => "oom_score_adj"
);

// TODO: overlay_volumes
impl_vec_field!(
/// Overlay volumes are named volumes that will be added to the container.
overlay_volumes : models::OverlayVolume => "overlay_volumes"
);

impl_field!(
/// Specify the Linux personality syscall input.
Expand Down Expand Up @@ -653,7 +675,10 @@ impl ContainerCreateOptsBuilder {
publish_image_ports: bool => "publish_image_ports"
);

// TODO: r_limits
impl_vec_field!(
/// Rlimits are POSIX rlimits to apply to the container. Optional.
r_limits : models::PosixRlimit => "r_limits"
);

impl_str_field!(
/// The user-specified and unprocessed input referring to a local or a remote image.
Expand Down Expand Up @@ -729,7 +754,10 @@ impl ContainerCreateOptsBuilder {
secret_env => "secret_env"
);

// TODO: secrets
impl_vec_field!(
/// Secrets are the secrets that will be added to the container.
secrets :models::Secret => "secrets"
);

impl_vec_field!(
/// The process label the container will use. if SELinux is enabled and this is not
Expand Down Expand Up @@ -778,10 +806,25 @@ impl ContainerCreateOptsBuilder {
terminal: bool => "terminal"
);

// TODO: throttleReadBpsDevice
// TODO: throttleReadIOPSDevice
// TODO: throttleWriteBpsDevice
// TODO: throttleWriteIOPSDevice
impl_map_field!(json
/// IO read rate limit per cgroup per device, bytes per second
throttle_read_bps_device => "throttleReadBpsDevice"
);

impl_map_field!(json
///IO read rate limit per cgroup per device, IO per second
throttle_read_iops_device => "throttleReadIOPSDevice"
);

impl_map_field!(json
/// IO write rate limit per cgroup per device, bytes per second
throttle_write_bps_device => "throttleWriteBpsDevice"
);

impl_map_field!(json
/// IO write rate limit per cgroup per device, IO per second
throttle_write_iops_device => "throttleWriteIOPSDevice"
);

impl_field!(
/// A maximum time in seconds the container will run before main process is sent SIGKILL.
Expand Down Expand Up @@ -861,7 +904,10 @@ impl ContainerCreateOptsBuilder {
volatile: bool => "volatile"
);

// TODO: volumes
impl_vec_field!(
/// Specifies the container volume to use with this container.
volumes: models::NamedVolume => "volumes"
);

impl_vec_field!(
/// Set of containers whose volumes will be added to this container. The name or ID of the
Expand Down