From a690772cc5a39b96194246d89f3a01566ecf0ff3 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 17 Aug 2021 11:56:01 -0700 Subject: [PATCH] add support to set subnet license for embedded console (#12993) --- cmd/common-main.go | 5 +++++ cmd/globals.go | 3 +++ internal/config/constants.go | 1 + 3 files changed, 9 insertions(+) diff --git a/cmd/common-main.go b/cmd/common-main.go index a3bb03701..576cedb51 100644 --- a/cmd/common-main.go +++ b/cmd/common-main.go @@ -152,6 +152,9 @@ func minioConfigToConsoleFeatures() { } os.Setenv("CONSOLE_MINIO_REGION", globalServerRegion) os.Setenv("CONSOLE_CERT_PASSWD", env.Get("MINIO_CERT_PASSWD", "")) + if globalSubnetLicense != "" { + os.Setenv("CONSOLE_SUBNET_LICENSE", globalSubnetLicense) + } } func initConsoleServer() (*restapi.Server, error) { @@ -596,6 +599,8 @@ func handleCommonEnvVars() { if tiers := env.Get("_MINIO_DEBUG_REMOTE_TIERS_IMMEDIATELY", ""); tiers != "" { globalDebugRemoteTiersImmediately = strings.Split(tiers, ",") } + + globalSubnetLicense = env.Get(config.EnvMinIOSubnetLicense, "") } func logStartupMessage(msg string) { diff --git a/cmd/globals.go b/cmd/globals.go index 0bcf23e32..636da56c0 100644 --- a/cmd/globals.go +++ b/cmd/globals.go @@ -216,6 +216,9 @@ var ( // The name of this local node, fetched from arguments globalLocalNodeName string + // The global subnet license + globalSubnetLicense string + globalRemoteEndpoints map[string]Endpoint // Global server's network statistics diff --git a/internal/config/constants.go b/internal/config/constants.go index a58ec329e..f8cf35b0b 100644 --- a/internal/config/constants.go +++ b/internal/config/constants.go @@ -37,6 +37,7 @@ const ( EnvArgs = "MINIO_ARGS" EnvDNSWebhook = "MINIO_DNS_WEBHOOK_ENDPOINT" + EnvMinIOSubnetLicense = "MINIO_SUBNET_LICENSE" EnvMinIOServerURL = "MINIO_SERVER_URL" EnvMinIOBrowserRedirectURL = "MINIO_BROWSER_REDIRECT_URL" EnvRootDiskThresholdSize = "MINIO_ROOTDISK_THRESHOLD_SIZE"