From 5d72ea6a6d6ea3502aed69c3c0a7237bdbf67767 Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Wed, 1 Jan 2025 12:18:39 +0200 Subject: [PATCH] feat(storage.yaml): Add new storage Add new kernelci-storage definition. It is plain http storage, already supported as "backend". Signed-off-by: Denys Fedoryshchenko --- config/core/storage.yaml | 5 +++++ config/runtime/base/kubernetes.jinja2 | 4 ++-- kernelci/runtime/kubernetes.py | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/core/storage.yaml b/config/core/storage.yaml index ceb98f871d..069dcddecc 100644 --- a/config/core/storage.yaml +++ b/config/core/storage.yaml @@ -24,3 +24,8 @@ storage: host: staging.kernelci.org base_url: http://storage.staging.kernelci.org/ api_url: https://api.staging.kernelci.org + + kci-storage: + storage_type: backend + base_url: http://mon.kernelci.org:3000/ + api_url: http://mon.kernelci.org:3000/ diff --git a/config/runtime/base/kubernetes.jinja2 b/config/runtime/base/kubernetes.jinja2 index 0f872e6efa..c0569db0d0 100644 --- a/config/runtime/base/kubernetes.jinja2 +++ b/config/runtime/base/kubernetes.jinja2 @@ -63,8 +63,8 @@ spec: #value: {{ "/home/kernelci/.ssh/id_rsa_tarball-staging" }} valueFrom: secretKeyRef: - name: {{ "kci-api-azure-files-sas-staging" }} - key: azure-files-sas + name: kci-storage-tokens + key: {{ k8s_storage_token_name }} {% block k8s_command %} command: ["/bin/sh", "-c"] {% endblock %} diff --git a/kernelci/runtime/kubernetes.py b/kernelci/runtime/kubernetes.py index b45a0aa187..723dfebccf 100644 --- a/kernelci/runtime/kubernetes.py +++ b/kernelci/runtime/kubernetes.py @@ -40,8 +40,10 @@ def generate(self, job, params): instance = os.getenv('KCI_INSTANCE', 'prod') if instance == 'prod': params['k8s_api_key'] = 'kci-api-jwt-early-access' + params['k8s_storage_token_name'] = 'production' else: params['k8s_api_key'] = 'kci-api-jwt-staging' + params['k8s_storage_token_name'] = 'staging' params['k8s_job_name'] = k8s_job_name return template.render(params)