From f816bb41975902a291f432308485a0ddad31e145 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= <rpiliszek@7bulls.com>
Date: Thu, 15 Feb 2024 20:34:05 +0100
Subject: [PATCH] Install buildset registry CA certificate in minikube

Change-Id: I95d8d3915d7e4b735497359e8c8fa167c15ee267
---
 playbooks/helm/pre.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/playbooks/helm/pre.yaml b/playbooks/helm/pre.yaml
index 25e4a2a..bac8f0e 100644
--- a/playbooks/helm/pre.yaml
+++ b/playbooks/helm/pre.yaml
@@ -19,3 +19,11 @@
 
     - name: Replace minikube kubelet config.json
       shell: minikube cp ~/.docker/config.json /var/lib/kubelet/config.json
+
+    - name: Install buildset registry CA certificate in minikube
+      block:
+        - name: Copy the CA certificate from the host to minikube
+          command: "minikube cp /usr/local/share/ca-certificates/{{ buildset_registry_alias }}.crt /usr/local/share/ca-certificates/{{ buildset_registry_alias }}.crt"
+
+        - name: Run update-ca-certificates in minikube
+          command: "minikube ssh 'sudo update-ca-certificates'"