File tree 3 files changed +20
-4
lines changed
plural/helm/plural/templates
3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ defmodule Core.Clients.Console do
42
42
"""
43
43
44
44
def new ( url , token ) do
45
- Req . new ( base_url: url , auth: "Token #{ token } " )
45
+ Req . new ( base_url: with_gql ( url ) , auth: "Token #{ token } " )
46
46
|> AbsintheClient . attach ( )
47
47
end
48
48
@@ -93,4 +93,11 @@ defmodule Core.Clients.Console do
93
93
Logger . error "failed to fetch from console: #{ inspect ( resp ) } "
94
94
{ :error , "console error" }
95
95
end
96
+
97
+ defp with_gql ( url ) do
98
+ case String . ends_with? ( url , "/gql" ) do
99
+ true -> url
100
+ _ -> "#{ url } /gql"
101
+ end
102
+ end
96
103
end
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ defmodule Core.Services.Cloud.Poller do
3
3
alias Core.Clients.Console
4
4
alias Core.Services.Cloud
5
5
alias Kazan.Apis.Core.V1 , as: CoreV1
6
+ require Logger
6
7
7
8
@ poll :timer . minutes ( 5 )
8
9
@@ -28,7 +29,9 @@ defmodule Core.Services.Cloud.Poller do
28
29
def handle_info ( :repo , % { client: client } = state ) do
29
30
case Console . repo ( client , Core . conf ( :mgmt_repo ) ) do
30
31
{ :ok , id } -> { :noreply , % { state | repo: id } }
31
- _ -> { :noreply , state }
32
+ err ->
33
+ Logger . warn "failed to find mgmt repo: #{ inspect ( err ) } "
34
+ { :noreply , state }
32
35
end
33
36
end
34
37
@@ -41,8 +44,11 @@ defmodule Core.Services.Cloud.Poller do
41
44
end
42
45
43
46
def handle_info ( :roaches , state ) do
44
- with { :ok , roaches } <- read_secret ( ) do
45
- Enum . each ( roaches , & upsert_roach / 1 )
47
+ case read_secret ( ) do
48
+ { :ok , roaches } ->
49
+ Enum . each ( roaches , & upsert_roach / 1 )
50
+ err ->
51
+ Logger . warn "failed to fetch available cockroach clusters: #{ inspect ( err ) } "
46
52
end
47
53
{ :noreply , state }
48
54
end
Original file line number Diff line number Diff line change 8
8
- apiGroups : [""]
9
9
resources : ["endpoints", "pods"]
10
10
verbs : ["get", "list", "watch"]
11
+ - apiGroups : [""]
12
+ resources : ["secrets"]
13
+ verbs : ["get", "list", "watch"]
11
14
- apiGroups : ["batch", "extensions"]
12
15
resources : ["jobs"]
13
16
verbs : ["get", "list", "watch"]
You can’t perform that action at this time.
0 commit comments