From 093ff410b47650f218e7c568845377ebcc178bc2 Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Mon, 30 Sep 2024 13:20:44 -0700 Subject: [PATCH] Ability to recongnize Embedded Clusters in kurl proxy --- kurl_proxy/cmd/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kurl_proxy/cmd/main.go b/kurl_proxy/cmd/main.go index 21f41391f2..79aa905054 100644 --- a/kurl_proxy/cmd/main.go +++ b/kurl_proxy/cmd/main.go @@ -275,9 +275,10 @@ func getHttpServer(fingerprint string, acceptAnonymousUploads bool, assetsDir st } appIcon := template.URL(app.Spec.Icon) c.HTML(http.StatusOK, "insecure.html", gin.H{ - "fingerprintSHA1": fingerprint, - "AppIcon": appIcon, - "AppTitle": app.Spec.Title, + "fingerprintSHA1": fingerprint, + "AppIcon": appIcon, + "AppTitle": app.Spec.Title, + "IsEmbeddedCluster": isEmbeddedCluster(), }) }) r.NoRoute(func(c *gin.Context) { @@ -677,3 +678,7 @@ func generateCertHostnames(namespace string) (string, []string) { return DEFAULT_KOTSADM_CERT_CN, altNames } + +func isEmbeddedCluster() bool { + return os.Getenv("EMBEDDED_CLUSTER_ID") != "" +}