From 06afcf27a352299330c1ff3d53e8efaf703151bd Mon Sep 17 00:00:00 2001 From: klinch0 <68821526+klinch0@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:13:57 +0300 Subject: [PATCH] feature/fix-k8s-config-with-OIDC (#594) ## Summary by CodeRabbit - **Chores** - Updated tenant application version from 1.6.6 to 1.6.7 - Updated version tracking in package management system - Minor configuration adjustments in kubeconfig template - Enhanced logic for determining API server endpoint based on kubeconfig presence --- packages/apps/tenant/Chart.yaml | 2 +- packages/apps/tenant/templates/kubeconfig.yaml | 6 +++++- packages/apps/versions_map | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/apps/tenant/Chart.yaml b/packages/apps/tenant/Chart.yaml index 89a884a27..5d83ea1bd 100644 --- a/packages/apps/tenant/Chart.yaml +++ b/packages/apps/tenant/Chart.yaml @@ -4,4 +4,4 @@ description: Separated tenant namespace icon: /logos/tenant.svg type: application -version: 1.6.6 +version: 1.6.7 diff --git a/packages/apps/tenant/templates/kubeconfig.yaml b/packages/apps/tenant/templates/kubeconfig.yaml index 408bc8c75..85a2acd16 100644 --- a/packages/apps/tenant/templates/kubeconfig.yaml +++ b/packages/apps/tenant/templates/kubeconfig.yaml @@ -4,9 +4,13 @@ {{- if $k8sClientSecret }} {{- $apiServerEndpoint := index $cozyConfig.data "api-server-endpoint" }} +{{- $managementKubeconfigEndpoint := default "" (get $cozyConfig.data "management-kubeconfig-endpoint") }} +{{- if and $managementKubeconfigEndpoint (ne $managementKubeconfigEndpoint "") }} +{{- $apiServerEndpoint = $managementKubeconfigEndpoint }} +{{- end }} {{- $k8sClient := index $k8sClientSecret.data "client-secret-key" | b64dec }} {{- $rootSaConfigMap := lookup "v1" "ConfigMap" "kube-system" "kube-root-ca.crt" }} -{{- $k8sCa := index $rootSaConfigMap.data "ca.crt" | b64enc }} +{{- $k8sCa := index $rootSaConfigMap.data "ca.crt" | b64enc }} --- apiVersion: v1 kind: Secret diff --git a/packages/apps/versions_map b/packages/apps/versions_map index 8fe11ebac..15f3caf90 100644 --- a/packages/apps/versions_map +++ b/packages/apps/versions_map @@ -99,7 +99,8 @@ tenant 1.6.2 ccedc5fe tenant 1.6.3 2057bb96 tenant 1.6.4 3c9e50a4 tenant 1.6.5 f1e11451 -tenant 1.6.6 HEAD +tenant 1.6.6 d4634797 +tenant 1.6.7 HEAD virtual-machine 0.1.4 f2015d6 virtual-machine 0.1.5 7cd7de7 virtual-machine 0.2.0 5ca8823