Skip to main content

StartRequest

Struct StartRequest 

Source
pub struct StartRequest {
    pub exec_id: String,
    pub command: Vec<String>,
    pub shell: Shell,
    pub cwd: Option<String>,
    pub env: HashMap<String, String>,
    pub user: Option<NameOrId>,
    pub group: Option<NameOrId>,
    pub timeout_sec: Option<f64>,
    pub stdin: bool,
    pub reap_group_on_exit: bool,
    pub inherit_image_env: bool,
}
Expand description

A start request. command is either an argv array or, with shell set, a single script string.

Fields§

§exec_id: String

Caller-minted idempotency key. Harbor retries, and a retry must not produce a second child.

§command: Vec<String>

argv when shell is false, or the script when it is set.

§shell: Shell

false, true (/bin/sh -c), or a shell name such as "bash". A name the guest cannot resolve answers 400 unknown_shell before anything is spawned.

§cwd: Option<String>

Omitted means inherit the daemon’s working directory. See the module docs.

§env: HashMap<String, String>§user: Option<NameOrId>

The user to demote to: a numeric uid, or a name resolved against the guest’s /etc/passwd. Optional; omitted means run as the daemon’s own user. A name the guest does not have answers 400 unknown_user before anything is spawned.

A user with a passwd row, however it was given, gets HOME, USER and LOGNAME from the row, beneath the launch environment and env. A user given by name also gets the row’s primary gid when group is omitted; a numeric uid keeps the daemon’s group, as it always did.

§group: Option<NameOrId>

The group to demote to: a numeric gid, or a name resolved against /etc/group. A name the guest does not have answers 400 unknown_group.

§timeout_sec: Option<f64>

Wall-clock budget. Validated before the child spawns — the predecessor raised on a bad value inside the waiter thread, by which point the child was already running and became an orphan.

§stdin: bool

Whether to give the child a writable stdin pipe. Defaults to false, which keeps Stdio::null().

Opt-in rather than always-on, and not only for tidiness: a child holding an open stdin pipe nobody will ever write to is a child that blocks forever the first time it reads. /bin/sh reading a script from stdin, git deciding it can prompt, any tool that probes for input — all of them behave differently against a pipe than against /dev/null. Every existing caller gets today’s behavior by not setting this.

§reap_group_on_exit: bool

Whether to signal the exec’s whole process group once its own child exits.

Off by default, and the default is the contract this daemon has always had: a backgrounded grandchild that inherited the output pipe keeps running and keeps writing, and the linger deadline is what bounds how long the daemon waits on it. That is the “backgrounded server keeps logging” guarantee, and callers rely on it. Set to true, the daemon runs the same SIGTERM-then- SIGKILL escalation POST /v1/exec/{id}/kill uses against the group as soon as the child’s exit is observed, so nothing the command left behind outlives it and the linger sees EOF rather than writers_may_be_alive. A timed-out exec is already escalated and is not escalated twice.

§inherit_image_env: bool

Whether the child’s environment starts from the image’s ENV.

Off by default, which keeps the property the daemon has always had: nothing from its own environment reaches a child. Set, the environment the daemon inherited as the container CMD, minus every AGENTD_* variable, is the lowest layer, under the passwd identity, the launch environment and env. The agent token is never in that snapshot: it arrives in the run hook, after the snapshot is taken.

A daemon that predates this field ignores it, as serde ignores any unknown key; a caller that depends on it can read image_env_keys on GET /v1/health, which such a daemon does not report.

Trait Implementations§

Source§

impl Debug for StartRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StartRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for StartRequest

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for StartRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.