Skip to content

Commit d29918e

Browse files
authored
Merge pull request #22 from projectsyn/feat/api-timeout
Add the configurability of the cloudscale API timeout
2 parents 706f4c0 + b9ba4ad commit d29918e

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

class/defaults.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ parameters:
1313

1414
args: []
1515

16+
api_timeout_seconds: null
1617
api_token: ?{vaultkv:${cluster:tenant}/${cluster:name}/cloudscale/token}

component/main.jsonnet

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ local patchDaemonset(obj) =
3636
'%(registry)s/%(repository)s:%(tag)s' %
3737
params.images.cloudscale_cloud_controller_manager,
3838
command+: params.args,
39+
env+:
40+
if params.api_timeout_seconds != null then [
41+
{
42+
name: 'CLOUDSCALE_API_TIMEOUT',
43+
value: std.toString(params.api_timeout_seconds),
44+
},
45+
] else [],
3946
}
4047
else
4148
c

docs/modules/ROOT/pages/references/parameters.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ defaults:: `[]`
4343
Additional arguments to provide to the cloudscale CCM.
4444
The contents of this parameter are appended to the upstream manifest verbatim.
4545

46+
== `api_timeout_seconds`
47+
48+
[horizontal]
49+
type:: number
50+
default:: `null`
51+
52+
The API timeout to be used by the CCM driver when communicating with the cloudscale.ch API.
53+
Unit is seconds.
54+
If not set the CCM driver will use its upstream default.
55+
56+
The current upstream timeout default is 20 seconds (https://github.com/cloudscale-ch/cloudscale-cloud-controller-manager/blob/74832bae401dc0fc79dcfba923ae154eac684779/pkg/cloudscale_ccm/cloud.go#L28[upstream code]).
57+
4658
== `api_token`
4759

4860
[horizontal]

tests/golden/openshift4/cloudscale-cloud-controller-manager/cloudscale-cloud-controller-manager/10_ccm_daemonset_kube_system_cloudscale_cloud_controller_manager.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ spec:
2828
secretKeyRef:
2929
key: access-token
3030
name: cloudscale
31+
- name: CLOUDSCALE_API_TIMEOUT
32+
value: '50'
3133
image: quay.io/cloudscalech/cloudscale-cloud-controller-manager:1.2.0
3234
imagePullPolicy: IfNotPresent
3335
name: cloudscale-cloud-controller-manager

tests/openshift4.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
parameters:
22
facts:
33
distribution: openshift4
4+
5+
cloudscale_cloud_controller_manager:
6+
api_timeout_seconds: 50

0 commit comments

Comments
 (0)