From f2e50b9f25eb043a10a516df97576b153009372b Mon Sep 17 00:00:00 2001 From: Gabriel Mainberger Date: Wed, 3 Dec 2025 16:55:59 +0100 Subject: [PATCH] Add the conditional configurability of the cloudscale API timeout --- class/defaults.yml | 2 ++ component/main.jsonnet | 6 ++++++ docs/modules/ROOT/pages/references/parameters.adoc | 8 ++++++++ ...t_kube_system_cloudscale_cloud_controller_manager.yaml | 2 ++ tests/openshift4.yml | 3 +++ 5 files changed, 21 insertions(+) diff --git a/class/defaults.yml b/class/defaults.yml index 0356235..836e1d0 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -13,4 +13,6 @@ parameters: args: [] + api_timeout: 20 + api_timeout_default: 20 api_token: ?{vaultkv:${cluster:tenant}/${cluster:name}/cloudscale/token} diff --git a/component/main.jsonnet b/component/main.jsonnet index 6b76694..b06b8a5 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -36,6 +36,12 @@ local patchDaemonset(obj) = '%(registry)s/%(repository)s:%(tag)s' % params.images.cloudscale_cloud_controller_manager, command+: params.args, + [if params.api_timeout != params.api_timeout_default then 'env']+: [ + { + name: 'CLOUDSCALE_API_TIMEOUT', + value: params.api_timeout, + }, + ], } else c diff --git a/docs/modules/ROOT/pages/references/parameters.adoc b/docs/modules/ROOT/pages/references/parameters.adoc index 091c0e3..ebc39b5 100644 --- a/docs/modules/ROOT/pages/references/parameters.adoc +++ b/docs/modules/ROOT/pages/references/parameters.adoc @@ -43,6 +43,14 @@ defaults:: `[]` Additional arguments to provide to the cloudscale CCM. The contents of this parameter are appended to the upstream manifest verbatim. +== `api_timeout` + +[horizontal] +type:: string +default:: https://github.com/cloudscale-ch/cloudscale-cloud-controller-manager/blob/74832bae401dc0fc79dcfba923ae154eac684779/pkg/cloudscale_ccm/cloud.go#L28 + +cloudscale.ch API timeout to be used by the CCM driver. + == `api_token` [horizontal] diff --git a/tests/golden/openshift4/cloudscale-cloud-controller-manager/cloudscale-cloud-controller-manager/10_ccm_daemonset_kube_system_cloudscale_cloud_controller_manager.yaml b/tests/golden/openshift4/cloudscale-cloud-controller-manager/cloudscale-cloud-controller-manager/10_ccm_daemonset_kube_system_cloudscale_cloud_controller_manager.yaml index 346bdb5..1b0ba46 100644 --- a/tests/golden/openshift4/cloudscale-cloud-controller-manager/cloudscale-cloud-controller-manager/10_ccm_daemonset_kube_system_cloudscale_cloud_controller_manager.yaml +++ b/tests/golden/openshift4/cloudscale-cloud-controller-manager/cloudscale-cloud-controller-manager/10_ccm_daemonset_kube_system_cloudscale_cloud_controller_manager.yaml @@ -28,6 +28,8 @@ spec: secretKeyRef: key: access-token name: cloudscale + - name: CLOUDSCALE_API_TIMEOUT + value: 60 image: quay.io/cloudscalech/cloudscale-cloud-controller-manager:1.2.0 imagePullPolicy: IfNotPresent name: cloudscale-cloud-controller-manager diff --git a/tests/openshift4.yml b/tests/openshift4.yml index 97d8e9b..4015f52 100644 --- a/tests/openshift4.yml +++ b/tests/openshift4.yml @@ -1,3 +1,6 @@ parameters: facts: distribution: openshift4 + + cloudscale_cloud_controller_manager: + api_timeout: 60