Skip to content

Commit b9ba4ad

Browse files
committed
Allow unset value for upstream default, improve docs, include unit in name, allow numbers
1 parent 995669d commit b9ba4ad

6 files changed

Lines changed: 20 additions & 14 deletions

File tree

class/defaults.yml

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

1414
args: []
1515

16-
api_timeout: '20'
16+
api_timeout_seconds: null
1717
api_token: ?{vaultkv:${cluster:tenant}/${cluster:name}/cloudscale/token}

component/main.jsonnet

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +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-
{
41-
name: 'CLOUDSCALE_API_TIMEOUT',
42-
value: params.api_timeout,
43-
},
44-
],
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 [],
4546
}
4647
else
4748
c

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,17 @@ 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`
46+
== `api_timeout_seconds`
4747

4848
[horizontal]
49-
type:: string
50-
default:: https://github.com/cloudscale-ch/cloudscale-cloud-controller-manager/blob/74832bae401dc0fc79dcfba923ae154eac684779/pkg/cloudscale_ccm/cloud.go#L28
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.
5155

52-
cloudscale.ch API timeout to be used by the CCM driver.
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]).
5357

5458
== `api_token`
5559

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
key: access-token
3030
name: cloudscale
3131
- name: CLOUDSCALE_API_TIMEOUT
32-
value: '20'
32+
value: '50'
3333
image: quay.io/cloudscalech/cloudscale-cloud-controller-manager:1.2.0
3434
imagePullPolicy: IfNotPresent
3535
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)