Bläddra i källkod

struct field to tenant & references to field

theguy951357 2 år sedan
förälder
incheckning
84a78fb04c
3 ändrade filer med 10 tillägg och 10 borttagningar
  1. 1 1
      config/config.go
  2. 3 3
      ee/license.go
  3. 6 6
      servercfg/serverconf.go

+ 1 - 1
config/config.go

@@ -71,7 +71,7 @@ type ServerConfig struct {
 	MetricsExporter            string    `yaml:"metrics_exporter"`
 	BasicAuth                  string    `yaml:"basic_auth"`
 	LicenseValue               string    `yaml:"license_value"`
-	NetmakerAccountID          string    `yaml:"netmaker_tenant_id"`
+	NetmakerTenantID           string    `yaml:"netmaker_tenant_id"`
 	IsEE                       string    `yaml:"is_ee"`
 	StunPort                   int       `yaml:"stun_port"`
 	StunList                   string    `yaml:"stun_list"`

+ 3 - 3
ee/license.go

@@ -48,9 +48,9 @@ func AddLicenseHooks() {
 // if license is not valid, server should terminate
 func ValidateLicense() error {
 	licenseKeyValue := servercfg.GetLicenseKey()
-	netmakerAccountID := servercfg.GetNetmakerAccountID()
+	NetmakerTenantID := servercfg.GetNetmakerTenantID()
 	logger.Log(0, "proceeding with Netmaker license validation...")
-	if len(licenseKeyValue) == 0 || len(netmakerAccountID) == 0 {
+	if len(licenseKeyValue) == 0 || len(NetmakerTenantID) == 0 {
 		logger.FatalLog0(errValidation.Error())
 	}
 
@@ -65,7 +65,7 @@ func ValidateLicense() error {
 	}
 
 	licenseSecret := LicenseSecret{
-		AssociatedID: netmakerAccountID,
+		AssociatedID: NetmakerTenantID,
 		Limits:       getCurrentServerLimit(),
 	}
 

+ 6 - 6
servercfg/serverconf.go

@@ -670,13 +670,13 @@ func GetLicenseKey() string {
 	return licenseKeyValue
 }
 
-// GetNetmakerAccountID - get's the associated, Netmaker, account ID to verify ownership
-func GetNetmakerAccountID() string {
-	netmakerAccountID := os.Getenv("NETMAKER_TENANT_ID")
-	if netmakerAccountID == "" {
-		netmakerAccountID = config.Config.Server.NetmakerAccountID
+// GetNetmakerTenantID - get's the associated, Netmaker, tenant ID to verify ownership
+func GetNetmakerTenantID() string {
+	NetmakerTenantID := os.Getenv("NETMAKER_TENANT_ID")
+	if NetmakerTenantID == "" {
+		NetmakerTenantID = config.Config.Server.NetmakerTenantID
 	}
-	return netmakerAccountID
+	return NetmakerTenantID
 }
 
 // GetStunPort - Get the port to run the stun server on