From 379b4e24721523507e1da27eaa08e372234c09a9 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Mon, 8 Jul 2024 07:18:27 -0300 Subject: [PATCH] No need to filter containers here --- config/faaso.yml | 2 +- config/funkos | 8 ++++++++ src/funko.cr | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 config/funkos diff --git a/config/faaso.yml b/config/faaso.yml index 2f89fe7..2ede76b 100644 --- a/config/faaso.yml +++ b/config/faaso.yml @@ -1 +1 @@ -password: admin +password: adminfoo diff --git a/config/funkos b/config/funkos new file mode 100644 index 0000000..8e691f2 --- /dev/null +++ b/config/funkos @@ -0,0 +1,8 @@ + + handle_path /faaso/hello/* { + reverse_proxy /* http://faaso-hello-9zth8p:3000 { + health_uri /ping + fail_duration 30s + } + } + \ No newline at end of file diff --git a/src/funko.cr b/src/funko.cr index f37efda..cb799e4 100644 --- a/src/funko.cr +++ b/src/funko.cr @@ -99,7 +99,8 @@ module Funko sleep 0.1.seconds } else - containers.select { |container| container.@state == "running" }.sort! { |i, j| + # Sort them older to newer, so we stop the oldest + containers.sort! { |i, j| i.@created <=> j.@created }.each { |container| Log.info { "Removing instance" }