Skip to content

Commit 9be07d5

Browse files
committed
Use HOSTNAME env as app id
Signed-off-by: Ryan Levick <[email protected]>
1 parent 0c6943f commit 9be07d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

containerd-shim-spin/src/engine.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ impl SpinEngine {
168168

169169
let mut futures_list = Vec::new();
170170
let mut trigger_type_map = Vec::new();
171+
// The `HOSTNAME` environment variable should contain the fully unique container name
172+
let app_id = std::env::var("HOSTNAME").unwrap_or_else(|_| "unknown".into());
171173
for trigger_type in trigger_types.iter() {
172-
let app = spin_app::App::new("TODO", app.clone());
174+
let app = spin_app::App::new(&app_id, app.clone());
173175
let f = match trigger_type.as_str() {
174176
HTTP_TRIGGER_TYPE => {
175177
let address_str = env::var(constants::SPIN_HTTP_LISTEN_ADDR_ENV)

0 commit comments

Comments
 (0)