fn build_env(
    spec_env: &HashMap<String, String>,
    hostname: &str,
    device_id: &str,
    settings: &Settings<DockerConfig>,
) -> HashMap<String, String> {
    let mut env = HashMap::new();
    env.insert(HOSTNAME_KEY.to_string(), hostname.to_string());
    env.insert(
        GATEWAY_HOSTNAME_KEY.to_string(),
        settings.hostname().to_string().to_lowercase(),
    );
    env.insert(DEVICEID_KEY.to_string(), device_id.to_string());
    env.insert(MODULEID_KEY.to_string(), EDGE_RUNTIME_MODULEID.to_string());
    env.insert(
        WORKLOAD_URI_KEY.to_string(),
        settings.connect().workload_uri().to_string(),
    );
    env.insert(
        MANAGEMENT_URI_KEY.to_string(),
        settings.connect().management_uri().to_string(),
    );
    env.insert(AUTHSCHEME_KEY.to_string(), AUTH_SCHEME.to_string());
    env.insert(
        EDGE_RUNTIME_MODE_KEY.to_string(),
        EDGE_RUNTIME_MODE.to_string(),
    );
    env.insert(
        EDGE_NETWORKID_KEY.to_string(),
        settings.moby_runtime().network().to_string(),
    );
    for (key, val) in spec_env.iter() {
        env.insert(key.clone(), val.clone());
    }
    env.insert(API_VERSION_KEY.to_string(), API_VERSION.to_string());
    env
}
// Add the environment variables needed by the EdgeAgent.
Add the environment variables needed by the EdgeAgent.
Add the environment variables needed by the EdgeAgent .
fn build_env(
    spec_env: &HashMap<String, String>,
    hostname: &str,
    device_id: &str,
    settings: &Settings<DockerConfig>,
) -> HashMap<String, String> {
    let mut env = HashMap::new();
    env.insert(HOSTNAME_KEY.to_string(), hostname.to_string());
    env.insert(
        GATEWAY_HOSTNAME_KEY.to_string(),
        settings.hostname().to_string().to_lowercase(),
    );
    env.insert(DEVICEID_KEY.to_string(), device_id.to_string());
    env.insert(MODULEID_KEY.to_string(), EDGE_RUNTIME_MODULEID.to_string());
    env.insert(
        WORKLOAD_URI_KEY.to_string(),
        settings.connect().workload_uri().to_string(),
    );
    env.insert(
        MANAGEMENT_URI_KEY.to_string(),
        settings.connect().management_uri().to_string(),
    );
    env.insert(AUTHSCHEME_KEY.to_string(), AUTH_SCHEME.to_string());
    env.insert(
        EDGE_RUNTIME_MODE_KEY.to_string(),
        EDGE_RUNTIME_MODE.to_string(),
    );
    env.insert(
        EDGE_NETWORKID_KEY.to_string(),
        settings.moby_runtime().network().to_string(),
    );
    for (key, val) in spec_env.iter() {
        env.insert(key.clone(), val.clone());
    }
    env.insert(API_VERSION_KEY.to_string(), API_VERSION.to_string());
    env
}
fn build_env ( spec_env : & HashMap < String , String > , hostname : & str , device_id : & str , settings : & Settings < DockerConfig > , ) -> HashMap < String , String > { let mut env = HashMap :: new ( ) ; env . insert ( HOSTNAME_KEY . to_string ( ) , hostname . to_string ( ) ) ; env . insert ( GATEWAY_HOSTNAME_KEY . to_string ( ) , settings . hostname ( ) . to_string ( ) . to_lowercase ( ) , ) ; env . insert ( DEVICEID_KEY . to_string ( ) , device_id . to_string ( ) ) ; env . insert ( MODULEID_KEY . to_string ( ) , EDGE_RUNTIME_MODULEID . to_string ( ) ) ; env . insert ( WORKLOAD_URI_KEY . to_string ( ) , settings . connect ( ) . workload_uri ( ) . to_string ( ) , ) ; env . insert ( MANAGEMENT_URI_KEY . to_string ( ) , settings . connect ( ) . management_uri ( ) . to_string ( ) , ) ; env . insert ( AUTHSCHEME_KEY . to_string ( ) , AUTH_SCHEME . to_string ( ) ) ; env . insert ( EDGE_RUNTIME_MODE_KEY . to_string ( ) , EDGE_RUNTIME_MODE . to_string ( ) , ) ; env . insert ( EDGE_NETWORKID_KEY . to_string ( ) , settings . moby_runtime ( ) . network ( ) . to_string ( ) , ) ; for ( key , val ) in spec_env . iter ( ) { env . insert ( key . clone ( ) , val . clone ( ) ) ; } env . insert ( API_VERSION_KEY . to_string ( ) , API_VERSION . to_string ( ) ) ; env }
Add the environment variables needed by the EdgeAgent.
Add the environment variables needed by the EdgeAgent .
spec_env
&HashMap<String, String>
hostname
&str
device_id
&str
settings
&Settings<DockerConfig>
spec_env
&HashMap<String, String>
hostname
&str
device_id
&str
settings
&Settings<DockerConfig>