-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Env Secrets in Server API #533
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
Still have an issue with the update And the delete show an error but work and delete the key. Signed-off-by: shiipou <[email protected]>
6871e98
to
ad3b028
Compare
I still have an issue with the update I have to find out why. |
Signed-off-by: shiipou <[email protected]>
if app get preloaded Signed-off-by: shiipou <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some refactoring must be done because there is functions definitions that have a quite high complexity as per the results of mix credo --strict.
We should make some functions easier to read and maintain.
Please look at mix credo --strict
command for more information.
Signed-off-by: shiipou <[email protected]>
Signed-off-by: shiipou <[email protected]>
|
||
case secret_response do | ||
{:ok, _} -> | ||
{:ok} -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You changed this case but it causes an error when trying to deploy an application.
Here are the logs :
11:10:37.446 request_id=F7juFiPvtMtTt9AAAprh [info] POST /api/apps/389/builds
11:10:37.582 request_id=F7juFiPvtMtTt9AAAprh [info] Sent 500 in 135ms
11:10:37.583 [error] #PID<0.24822.0> running LenraWeb.Endpoint (connection #PID<0.24819.0>, stream id 3) terminated
Server: api.staging.lenra.io:80 (http)
Request: POST /api/apps/389/builds
** (exit) an exception was raised:
** (CaseClauseError) no case clause matching: {:ok, %{APP_REPOSITORY: "https://github.com/lenra-io/template-bun-js.git", CALLBACK_URL: "http://lenra-server.lenra.svc.cluster.local:4000/runner/builds/915?secret=**********", IMAGE_NAME: "registry.gitlab.com/lenra/platform/lenra-ci/staging/dd14cd88-07d9-4711-9d4c-1a1d9d02b8b4:2", REPOSITORY_BRANCH: "secret"}}
(lenra 0.1.0) lib/lenra/kubernetes/api_services.ex:56: Lenra.Kubernetes.ApiServices.create_pipeline/6
(lenra 0.1.0) lib/lenra/apps.ex:266: Lenra.Apps.trigger_pipeline/3
(lenra 0.1.0) lib/lenra/apps.ex:240: Lenra.Apps.create_build_and_deploy/3
(lenra_web 0.1.0) lib/lenra_web/controllers/build_controller.ex:23: LenraWeb.BuildsController.create/2
(lenra_web 0.1.0) lib/lenra_web/controllers/build_controller.ex:1: LenraWeb.BuildsController.action/2
(lenra_web 0.1.0) lib/lenra_web/controllers/build_controller.ex:1: LenraWeb.BuildsController.phoenix_controller_pipeline/2
(phoenix 1.6.16) lib/phoenix/router.ex:354: Phoenix.Router.__call__/2
(lenra_web 0.1.0) lib/lenra_web/endpoint.ex:1: LenraWeb.Endpoint.plug_builder_call/2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shiipou I'm tagging you because I can't set this comment as blocking for the PR as I am the creator.
@shiipou I don't know why but when using this branch, the server won't open the websocket to the app. I tried to find the origin of the problem but there is no error on the server. |
@jonas-martinez I'll check this. |
About this PR
This PR enables the server to generate secrets on Kubernetes via the API, allowing OpenFaas to link these secrets when setting up an environment. This approach lets you utilize secrets in your application without embedding them directly into the Docker image.
Additionally, it introduces a new environment variable:
Technical highlight/advice
How to test my changes
Checklist
I included unit tests that cover my changes
I added/updated the documentation about my changes