Skip to content

Commit

Permalink
fix credo
Browse files Browse the repository at this point in the history
  • Loading branch information
mruoss committed Aug 23, 2024
1 parent d024d68 commit b76c506
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/flame_k8s_backend/http.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
defmodule FlameK8sBackend.HTTP do
@moduledoc false
alias Credo.CLI.Output.Formatter.JSON
alias FLAME.Parser.JSON

defstruct [:base_url, :token, :cacertfile]

Expand Down Expand Up @@ -30,7 +32,7 @@ defmodule FlameK8sBackend.HTTP do
{:ok, response_body} ->
response_body
|> List.to_string()
|> FLAME.Parser.JSON.decode!()
|> JSON.decode!()

{:error, reason} ->
raise reason
Expand Down
5 changes: 3 additions & 2 deletions lib/flame_k8s_backend/k8s_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ defmodule FLAMEK8sBackend.K8sClient do

@sa_token_path "/var/run/secrets/kubernetes.io/serviceaccount"

alias FLAME.Parser.JSON
alias FlameK8sBackend.HTTP

def connect() do
Expand All @@ -28,7 +29,7 @@ defmodule FLAMEK8sBackend.K8sClient do
{:ok,
response_body
|> List.to_string()
|> FLAME.Parser.JSON.decode!()}
|> JSON.decode!()}
end
end

Expand All @@ -38,7 +39,7 @@ defmodule FLAMEK8sBackend.K8sClient do

def create_pod!(http, pod, timeout) do
namespace = pod["metadata"]["namespace"]
created_pod = HTTP.post!(http, pod_path(namespace, ""), FLAME.Parser.JSON.encode!(pod))
created_pod = HTTP.post!(http, pod_path(namespace, ""), JSON.encode!(pod))
name = created_pod["metadata"]["name"]
wait_until_scheduled(http, namespace, name, timeout)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/flame_k8s_backend/runner_pod_template.ex
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ defmodule FLAMEK8sBackend.RunnerPodTemplate do
alias FLAMEK8sBackend.RunnerPodTemplate
import YamlElixir.Sigil
pod_template = ~y\"\"\"
pod_template = ~y\"""
apiVersion: v1
kind: Pod
metadata:
# your metadata
spec:
# Pod spec
\"\"\"
\"""
children = [
{FLAME.Pool,
Expand Down

0 comments on commit b76c506

Please sign in to comment.