Skip to content

Commit

Permalink
fix: OpenFaaS max scale label as string and min label to 1 on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
taorepoara committed Oct 31, 2023
1 parent 6890689 commit 1c6f1aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/lenra/lib/lenra/apps.ex
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ defmodule Lenra.Apps do
update_deployement(deployment, status: :waitingForAppReady)

spawn(fn ->
Logger.debug(
"#{__MODULE__} start waiting for app ready with params #{inspect(%{build: build, loaded_app: loaded_app, deployment: deployment})}"
)
update_deployement_after_deploy(
deployment,
loaded_app.main_env.environment,
Expand Down
5 changes: 3 additions & 2 deletions libs/application_runner/lib/services/application_services.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule ApplicationRunner.ApplicationServices do
@min_scale_label "com.openfaas.scale.min"
@max_scale_label "com.openfaas.scale.max"
@scale_factor_label "com.openfaas.scale.factor"
@min_scale_default "0"
@min_scale_default "1"
@max_scale_default "5"
@scale_factor_default "10"

Expand Down Expand Up @@ -206,7 +206,7 @@ defmodule ApplicationRunner.ApplicationServices do
image_name,
%{
@min_scale_label => @min_scale_default,
@max_scale_label => replicas,
@max_scale_label => to_string(replicas),
@scale_factor_label => @scale_factor_default
}
)
Expand Down Expand Up @@ -337,6 +337,7 @@ defmodule ApplicationRunner.ApplicationServices do

defp response({:ok, %Finch.Response{status: status_code}}, :deploy_app)
when status_code in [200, 202] do
Logger.debug("Openfaas application deployed")
{:ok, status_code}
end

Expand Down

0 comments on commit 1c6f1aa

Please sign in to comment.