From 1caa8edbad4b8b437eabe5435cb6bec593dae849 Mon Sep 17 00:00:00 2001 From: Dustin Black Date: Wed, 6 Sep 2023 16:03:09 +0200 Subject: [PATCH] import realm file from url --- controllers/keycloak.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/keycloak.go b/controllers/keycloak.go index 1575dbb..827a605 100644 --- a/controllers/keycloak.go +++ b/controllers/keycloak.go @@ -14,12 +14,18 @@ import ( ) func keycloakConfigMap(cr *hyperfoilv1alpha1.Horreum) *corev1.ConfigMap { - resp, err := http.Get("https://github.com/Hyperfoil/Horreum/blob/0.7.11/infra/keycloak-horreum.json") + req, err := http.NewRequest("GET", "https://github.com/Hyperfoil/Horreum/blob/0.7.11/infra/keycloak-horreum.json", nil) + if err != nil { + return nil + } + + resp, err := http.DefaultClient.Do(req) if err != nil { return nil } defer resp.Body.Close() + horreumRealm, err := io.ReadAll(resp.Body) if err != nil { return nil