From 7710deabd3a4f425b492f066ba4e52f87bc5186e Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Mon, 17 Mar 2025 17:42:20 +0530 Subject: [PATCH] fix for auto memcached setup --- functions/onprem/orborus/orborus.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 2f6af9fe..8cf902f6 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -456,18 +456,20 @@ func deployServiceWorkers(image string) { } } - isMemcachedRunning, err := checkMemcached(ctx, dockercli) - if err != nil { - log.Printf("[ERROR] Failed checking memcached: %s", err) - } - if isMemcachedRunning == false { - log.Printf("[ERROR] Memcached is not running. Will try to deploy it.") - deployMemcached(dockercli) - } + // Only do this if no memcached is set manually + if os.Getenv("SHUFFLE_MEMCACHED") == "" { + isMemcachedRunning, err := checkMemcached(ctx, dockercli) + if err != nil { + log.Printf("[ERROR] Failed checking memcached: %s", err) + } + if isMemcachedRunning == false { + log.Printf("[ERROR] Memcached is not running. Will try to deploy it.") + deployMemcached(dockercli) + } - ip := "shuffle-cache" - - os.Setenv("SHUFFLE_MEMCACHED", fmt.Sprintf("%s:11211", ip)) + ip := "shuffle-cache" + os.Setenv("SHUFFLE_MEMCACHED", fmt.Sprintf("%s:11211", ip)) + } defaultNetworkAttach := false if containerId != "" {