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

runtime: Add a domainname field support #111

Merged
merged 2 commits into from
Aug 29, 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
13 changes: 11 additions & 2 deletions src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub use vm::*;
pub use windows::*;

/// Base configuration for the container.
#[derive(Builder, Clone, Debug, Deserialize, Getters, Setters, PartialEq, Serialize)]
#[derive(Builder, Clone, Debug, Deserialize, Getters, Setters, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
#[builder(
default,
Expand Down Expand Up @@ -90,6 +90,15 @@ pub struct Spec {
/// the container UTS namespace may be the runtime UTS namespace.
hostname: Option<String>,

#[serde(default, skip_serializing_if = "Option::is_none")]
/// Specifies the container's domainame as seen by processes running
/// inside the container. On Linux, for example, this will
/// change the domainame in the container [UTS namespace](http://man7.org/linux/man-pages/man7/namespaces.7.html). Depending on your
/// [namespace
/// configuration](https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#namespaces),
/// the container UTS namespace may be the runtime UTS namespace.
domainname: Option<String>,

#[serde(default, skip_serializing_if = "Option::is_none")]
/// Hooks allow users to specify programs to run before or after various
/// lifecycle events. Hooks MUST be called in the listed order.
Expand Down Expand Up @@ -154,8 +163,8 @@ impl Default for Spec {
version: String::from("1.0.2-dev"),
process: Some(Default::default()),
root: Some(Default::default()),
// Defaults hostname as youki
hostname: "youki".to_string().into(),
domainname: None,
mounts: get_default_mounts().into(),
// Defaults to empty metadata
annotations: Some(Default::default()),
Expand Down